I have the string "Janáček, Leo" in a Perl variable. The three accented characters should be a-acute, c-caron, and s-caron (looks like the Perlmonks app is converting my c-caron into an e-grave).
Using Unicode codepoints, this is:
my $str = "Jan\x{00E1}\x{010D}ek, Leo\x{0161}";
I want to process this so that it (a) displays correctly in a sufficiently-recent browser, and (b) is correctly encoded into a URL - specifically to construct a Google link to search for Janacek references.
I've figured out (a), but getting stuck on (b). If you cut&paste the string into Google, it turns it into "Janáček, Leo" (which is fine, 269=0x010D). Hunting for modules that will generate a string that can be cleanly transmitted to Google via URL.
I've tried fooling with Unicode::String, HTML::Entities, and others. No luck so far. Suggestions appreciated.
It looks like a lot of sites have problems confusing c-caron and e-grave (codepoints 010D and 00E8). If you search Google for Janacek-with-e-grave, you'll get more results than for Janacek-with-c-caron. I have no idea why this is.
I'm setting charset=utf-8 everywhere: HTTP header, HTML HEAD meta tag, and FORM accept-charset attribute.
-Jason
In reply to Unicode, HTML, POST by jmay
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |