AFAICS it merely removes the UTF-8 flag, as the program below seems to demonstrateYes,and that's what it's supposed to do.
$a is a string containing 1 character, which happens to have a utf8 representation that takes two octets; $b is is string containing 2 characters, which represent each of the octets of $a's utf8 representation.use strict; use warnings; use Encode; $a = "\x{100}"; $b = Encode::encode_utf8($a); print "a = ", join(',', map ord($_), split //, $a), "\n"; print "b = ", join(',', map ord($_), split //, $b), "\n"; __END__ $ perl /tmp/p a = 256 b = 196,128 $
PS your if statement has the wrong logic; it prints "differ" when eq matches.
Dave.
In reply to Re: What does Encode::encode_utf8 do to UTF-8 data ?
by dave_the_m
in thread What does Encode::encode_utf8 do to UTF-8 data ?
by scollyer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |