In my current project , I forgot about character encoding and just let the application server do the right thing. This has been working fine for some time. For example, I was able to switch the language standard in my application to simplified Chinese / Chinese and see UTF-8 characters just fine in any recent Firefox or Chrome browsers. Something has changed (I'm still trying to figure that out). The content is still UTF-8 encoded, but sometimes the Content-type header sets the encoding incorrectly :
Content-Type:text/html;charset=ISO-8859-1
... causes garbage to appear in the browser instead of Chinese characters. If I temporarily encode UTF-8 in my browser, the characters are displayed correctly.
What really helps fix the problem is to know how the application server (or the dev web infrastructure like struts or spring?) Decides what to add to this header! Any ideas?
source
share