Subject: | Encoded results by "HZ" encoder have utf8 flag |
On Perl 5.10.0 (and maybe higher), encoded results by "HZ" encoder have
utf8 flag.
There is a test code:
---- >8 ---- >8 ---- >8 ---- >8 ---- >8 ---- >8 ----
use Encode qw(decode encode is_utf8);
$b = "START~{4sVGHtS^#,4sGIHgW>~}END"; # "START大智若愚,大巧如拙END"
$u = decode("HZ", $b);
$r = encode("HZ", $u);
print "u", is_utf8($u)? " is ": " is not ", "utf8\n";
print "r", is_utf8($r)? " is ": " is not ", "utf8\n";
---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ----
On Perl 5.8.5 + Encode 2.12, output is:
-------------
u is utf8
r is not utf8
-------------
However, on Perl 5.10.0 + Encode 2.23, output is:
-------------
u is utf8
r is utf8
-------------