[Perl] Trying to write text to a new unicode file (28)

21 Name: #!/usr/bin/anonymous : 2006-09-20 21:46 ID:6In1HFud

>>17
Here, have a spec:
http://www.w3.org/TR/html4/charset.html#doc-char-set

"The META declaration must only be used when the character encoding is organized such that ASCII-valued bytes stand for ASCII characters (at least until the META element is parsed). META declarations should appear as early as possible in the HEAD element."

So, you can use this tag that way, but using it when everything before the tag isn't ascii decodable is not valid HTML. It's normal to put the charset tag as the first element in HEAD anyways, or not? That means that you are not allowed to use some charsets together with the meta tag, but for when you have a useable charset (Say, UTF-8), it's a simple solution that works very well.

>>1
Even more spec stuff. Try setting accept-charset on your form. Don't know if browsers implement this, though.
http://www.w3.org/TR/html4/interact/forms.html#adef-accept-charset

>>20

>This is a shortcoming of HTTP, and there is no solution.

Wrong. The guys who invented the protocol/language thought of that, of course. Thats just basic escaping, you know. Try typing "&" into a some box, e.g. the google search box. The browser will convert it to "%26amp;" and if you type "%26amp;", it will turn into "%2526amp;". So, unless the user was talking to the server directly with telnet or something, everything will be properly escaped and the server will get exactly what the user typed.

This thread has been closed. You cannot post in this thread any longer.