Weird characters in Copy to Clipboard splash page
Weird characters in Copy to Clipboard splash page
In the Buttons plugin, the Copy to Clipboard button will put up two different splash pages, depending on the amount of data being copied.
The first splash page looks fine, it will copy the text to clipboard and then tell you how many rows were copied.
The second splash page will come up and ask you to ctrl-c to copy the larger amount of data. The problem is, this splash page has some weird characters. "Press ctrl or <weird characters> + c..."
Here's a screenshot: http://imgur.com/a/qCxt3
I've tested this in the latest Chrome, Firefox on Ubuntu and Edge on Windows 10. I'm not sure if this is a charset issue on my machines, or something else? Is anyone else seeing this issue?
These are my generated includes:
<link rel="stylesheet" type="text/css"
href="https://cdn.datatables.net/v/bs/jszip-2.5.0/pdfmake-0.1.18/dt-1.10.13/b-1.2.4/b-html5-1.2.4/b-print-1.2.4/datatables.min.css"/>
<script type="text/javascript"
src="https://cdn.datatables.net/v/bs/jszip-2.5.0/pdfmake-0.1.18/dt-1.10.13/b-1.2.4/b-html5-1.2.4/b-print-1.2.4/datatables.min.js"></script>
Here is my javascript:
$('#datatable').dataTable({
"aaSorting": [[0, 'desc']],
"aLengthMenu": [[10, 50, 100, 500, -1], [10, 50, 100, 500, "All"]],
"iDisplayLength": 500,
dom: '<"col-md-2"l><"col-md-offset-5 col-md-3"B>frtip',
buttons: [
'copy', 'excel', 'csv', 'print'
]
});
Replies
I figured out the issue. The character it's trying to display is the Apple command icon: <i>⌘</i>
If you go to https://cdn.datatables.net/buttons/1.2.4/js/buttons.html5.min.js: The code looks like this:
If you go to a Download Builder bundled version, https://cdn.datatables.net/v/bs/jszip-2.5.0/pdfmake-0.1.18/dt-1.10.13/b-1.2.4/b-html5-1.2.4/b-print-1.2.4/datatables.min.js, the code looks like this:
This looks like a charset bug with the Download builder to me. Where's the best place to file an issue for this?
Right here should do it, @kaevne. Looks like good work.
Good debugging - thanks for this! It sounds like the best option might be to use the unicode code point for the Apple command icon rather than just having the character in the code directly. I suspect that Closure compiler might be mangling it.
Allan