Linux system default encoding Utf-8
To modify and view the Linux coding problem:
[HTML]View plain copy [root@test-1 ~]# vi/etc/sysconfig/i18n lang= "en_US. UTF-8 "sysfont=" Latarcyrheb-sun16 "
Linux default encoding UFT-8, the terminal output default encoding is naturally UTF-8.
Windows using the SECURECRT default encoding is GBK, link to the Linux system output garbled, because Linux default is Utf-8, so the securecrt of the default encoding to Utf-8 on OK.
WINDOWS default Encoding GBK
Understanding the system platform's coding is easy to solve the coding problem.
The default encoding for Tomcat-initiated consoles in WIN7 is GBK, which is generally default to the system default character set.
The commonly used international encoding of Tomcat is Utf-8, and the application output adopts the system default encoding GBK,
So garbled, and then start the JVM set to-dfile.encoding= "UTF-8", the use of garbled problems to solve.
Here's another question:
Java.NET.URLEncoder.encode ("China"); If the encoding system is not added, the system is encoded by default. System.getproperty ("file.encoding");
If you jetty, Tomcat does not have the-dfile.encoding= "UTF-8" when it is started, the encoding problem occurs when the encryption is decrypted.
Solution:
The reason is because the default character set of the file.encoding is related to the operating system, the default character set below the Chinese operating system is GBK, if the process-defined XML file uses UTF-8,
is not converted correctly, you need to modify the value of file.encoding to UTF-8.
Files deployed in Tomcat to modify the value of file.encoding can be added after the set java_opts=%java_opts%%logging_config% in Tomcat's Catalina.bat file- Dfile.encoding= "UTF-8"