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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.