How can you detect client-side character encoding and pass it to the server?
The trick is the following:
1. Have a special chunk of text, Unicode-escaped.
2. Have the same chunk of text in native encodings for all the encodings available.
3. In Javascript, compare the first one with the set of encoded texts, until you find the one that matches.
4. You may send information about your discovery back to the server.
5. To make sure you catch the latest setting (user can change it), keep the texts in a form.
6. Of course the fields should be hidden, not to confuse the user.
P.S. It is in the process of being patented, see below.
http://appft1.uspto.gov/netacgi/nph-Parser?Sect1=PTO1&Sect2=HITOFF&d=PG01
&p=1&u=%2Fnetahtml%2FPTO%2Fsrchnum.html&r=1&f=G&l=50
&s1=%2220040205673%22.PGNR.&OS=DN/20040205673&RS=DN/20040205673
(paste these three lines together and copy the result to the address field in your browser)
The trick is the following:
1. Have a special chunk of text, Unicode-escaped.
2. Have the same chunk of text in native encodings for all the encodings available.
3. In Javascript, compare the first one with the set of encoded texts, until you find the one that matches.
4. You may send information about your discovery back to the server.
5. To make sure you catch the latest setting (user can change it), keep the texts in a form.
6. Of course the fields should be hidden, not to confuse the user.
P.S. It is in the process of being patented, see below.
http://appft1.uspto.gov/netacgi/nph-Parser?Sect1=PTO1&Sect2=HITOFF&d=PG01
&p=1&u=%2Fnetahtml%2FPTO%2Fsrchnum.html&r=1&f=G&l=50
&s1=%2220040205673%22.PGNR.&OS=DN/20040205673&RS=DN/20040205673
(paste these three lines together and copy the result to the address field in your browser)