Today, I have looked into HTML code of facebook.com, and found something like this:
<input type="hidden" value="€,´,€,´,水,Д,Є" name="charset_test"/>
It's repeated two times inside the <form>...</form>
.
Any idea what this code might be useful for - some kind of server-side client charset detection? As far as I know, browser charset is being transmitted in HTTP request anyway (an "Accept-Charset" header).
Any idea what this code might be useful for - some kind of server-side client charset detection?
Apparently so.
The Euro sign is useful for charset detection because there are so many ways of encoding it:
As far as I know, browser charset is being transmitted in HTTP request anyway (an "Accept-Charset" header).
It's supposed to transmitted in the HTTP Content-Type
header, but that doesn't mean that user agents actually get it right.
I guess they are matching this in the receiving script to make sure the client sent the request properly encoded as UTF-8 and maybe even, because they know what characters to expect, to detect the actual encoding on the fly.
If I remember correctly - I had to deal with it once - there have been problems with form encoding in IE6 in some situations.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With