I am developing a compressor and the result are bytes (ASCII 0-255) that I want to display in a TextArea (GWT), so that people can copy the compressed data and paste it as the value of a variable in their Javascript code. For example:
var s="alnj"; // alnj is the compressed code that they copied from the Text Area
The problem is that I cannot see some of these bytes (I just see like rectangles), and I am afraid people cannot copy&paste them successfully. What do you recommend me to solve this problem? Change the charset (utf-8)? Generate a JS file with the variable and the compressed code?
Thanks!
You could base64 the output.
Even when using UTF-8, there are still control characters present which will not render. The best solution most likely is to offer a “download” of the compressed data (=save as file dialog).
Regarding the copy and paste, you can offer a “copy to clipboard” button. However, as I do not know where users are supposed to paste the data to, troubles might arise there then.