in reply to Mixed ISO-8859/UTF-8 conversion
Please use Perl's built in support for encodings. Read perlunitut to find out all about Perl's Unicode strings.
sub decode_utf8_latin1 { my ($encoded) = @_; my $decoded; while (length $encoded) { $decoded .= decode("UTF-8", $encoded, Encode::FB_QUIET); $decoded .= substr($encoded, 0, 1, "") if length $encoded; } return $decoded; }
If CHECK = coderef worked, you could just write decode("UTF-8", $encoded, sub { chr shift }, but alas, it doesn't work.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Mixed ISO-8859/UTF-8 conversion
by olli (Initiate) on Oct 04, 2007 at 11:39 UTC | |
by Juerd (Abbot) on Oct 04, 2007 at 12:38 UTC |