I'm noticing that when posting a form through IE7, accented characters are开发者_如何学编程 getting messed up as soon as the request hits the server. But in FF3 it works just fine. The page encoding is set to ISO-8859-1. Is there any particular place I should start investigating?
Thanks in advance!
EDIT: The behavior I'm noticing is specifically a ü character when copied and pasted from word. If I paste it into IE7 from notepad it works fine.
It turns out that the AJAX request had not explicitly specified a charset request header. FF 3 seemed to have set it by default but IE7 would not. Once I had defined that on the AJAX request header it started working.
Thanks all for your help.
Check if your server is sending default charset header and turn it off if it is. You can use Live HTTP Headers Firefox extension.
- check if characters are mangled by client on send, or by server on receive (get a HTTP debugger for this- e.g. Fiddler)
- what kind of accented characters? ISO-8859-1 only has support for Western European accented chars; any others (e.g. "
šžý
") will be mangled because they are undefined in this encoding. - how are you setting the encoding? in HTTP header or in META tag?
It's not a silver bullet, but I'd recommend switching to UTF-8 if at all possible - the i18n and l10n hassles you'll save yourself are immense.
精彩评论