[Project_owners] Convert a windows-1251 encoded string into a UTF-8 string

Neil neil at parkwaycc.co.uk
Tue Jul 19 14:46:51 EDT 2005

Didier Ernotte wrote:

>I want to display in a textbox a windows-1251 encoded string that comes from the source of a web page (loaded from an XmlHttpRequest object). I guess I have to encode it into a UTF-8 string before displaying it in a textbox (direct display shows me garbage).
JavaScript uses UTF-16, not UTF-8. The XMLHttpRequest object already 
tries to decode the document using the appropriate character set. If you 
are getting the wrong character set then the server's configuration may 
be incorrect.

More information about the Project_owners mailing list