Update2: Which brings up a question. I know that I can send a HTTP request in Unicode. But how, in Latin-1 HTML, can I specify a link that would result in a HTTP request that contains Unicode characters (especially within a CGI parameter value) that aren't part of Latin-1? Is it impossible?What you can't do...
While you are correct that HTTP requests can contain Unicode, that's only true in the body of the HTTP request -- after the headers have allready been sent, and a both a mime type & character set (indicating that the body will be some particular Unicode character set) has been provided. You cannot use Unicode (or characters from any arbitrary character set) in the URL of the request itself, because HTTP has no mechanism for specify what the character set might be.
(See RFC 2396 for the specifics. (in particular, section 2.1) .. yes the RFC is 4 years old but I can't find anything that superceeds it.)
What you can do ...
RFC 2718 Clarifies the use of non US-ASCII characters in URLs: Characters should be converted (from whatever you current character set is) to it's UTF-8 representation, and then (if neccessary) escaped each byte into it's %xx hex notation.
Whether or not people/systems you send your URL to understand how to put those % escaped bytes back together as a UTF-8 character is between you and them. (Hopefully they're smart enough to pay attention to the first byte)
In reply to Re: (tye)Re: Unicode, HTML, POST
by hossman
in thread Unicode, HTML, POST
by jmay
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |