Page is a not externally linkable
phranque - 11:47 am on Aug 26, 2008 (gmt 0)
normally perl will see the (percent) encoded text and you are responsible for properly decoding the value. to explain: i'm not sure that this is much help for your character set so you might be better served to look at the perl Encode module (which includes japanese character mappings) and try the decode_utf8 method: hope this helps... [edited by: Woz at 12:49 am (utc) on Aug. 27, 2008]
i used a url decoding tool for UTF-8 and it converted to two reasonable-looking Japanese (Katakana?) characters:
日本
(this actually displays properly when i paste in the form but it gets converted when submitted)
something like this would typically work:
$value =~ s/%([\da-f][\da-f])/chr(hex($1))/egi
[\da-f] defines a character class for hexadecimal digits and it means a numerical digit or a letter 'a' through 'f'.
the statement takes the text string in $value and replaces any pair of hexadecimal digits that follows a percent and replaces it with the hex digits' value as converted by perl's chr function.
[search.cpan.org...]
[edit reason] Spelling, per request. [/edit]