in reply to UTF8 issues again
The "decode" call (provided the Encode module) might not be necessary, depending on what you need to do with the string value. If you're just going to print it to a "raw" file handle, just print it with no further ado. But to use it as utf8 text (or print to a file handle that has been set to use utf8 mode) you need to "decode" it first.use Encode; # ... assign goofy string value to $test ... $test =~ s/%([0-9A-F]{2})/chr(hex($1))/eg; # convert hex digits to oct +ets $test = decode( "utf8", $test ); # convert octets to unicode characte +rs
UPDATE: Of course, ikegami's approach is the better way to go.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: UTF8 issues again
by ultranerds (Hermit) on Sep 13, 2011 at 11:07 UTC |