Page is a not externally linkable
- Search Engines
-- Asia and Pacific Region
---- Asian characters in product-search


phranque - 11:47 am on Aug 26, 2008 (gmt 0)


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)

normally perl will see the (percent) encoded text and you are responsible for properly decoding the value.
something like this would typically work:
$value =~ s/%([\da-f][\da-f])/chr(hex($1))/egi

to explain:
[\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.

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:
[search.cpan.org...]

hope this helps...

[edited by: Woz at 12:49 am (utc) on Aug. 27, 2008]
[edit reason] Spelling, per request. [/edit]


Thread source:: http://www.webmasterworld.com/asia_pacific_search_engines/3730884.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com