Should I Change the Default Encoding?

Coordinator
Feb 24, 2012 at 11:47 PM

Right now the default input and output encoding is ASCII. Anyone think I should change it to be UTF-8? Would it break anyone if I did? ASCII input files should still parse just fine, but output files might have UTF-8-encoded characters rather than the ASCII \uXXXX encodings. Or maybe just change the input encoding to default to UTF-8, and leave the default output encoding as ASCII? What do you all think?

(Just a reminder: input encoding can be changed with the -enc:in switch, and output encoding with -enc:out)

Mar 7, 2012 at 5:12 AM

Some double bytes word may be look like garbled if input file's encodeing changed into UTF-8.

I hava a test, use C# to write a min a javascript file, use encoding.default to read file's content, aftered mined,write content to UTF-8 endoding,

open the mined javascript file, some word changed to garbled .

 

Coordinator
Mar 7, 2012 at 3:34 PM

You must always be mindful of what your input encoding is and set it appropriately. Likewise, you should be aware that if you set your output to a particular encoding, you open that file up with an application that can understand that encoding. Without any more details of what your source encoding is and what encoding the application you opened the minified file expects, I can't tell you what your encoding settings should be.