Am I doing something wrong or is this a bug: use strict; my $p; foreach $p (qw (C U C)) { my $s = pack($p, 200); print "pack('$p', 200): is_utf8=" . (utf8::is_utf8($s) ? 'yes' : 'no ') . "\t$s\t" . join(',', unpack('C*', $s)) . "\n"; }
Generates the following output: pack('C', 200): is_utf8=no ╚ 200 pack('U', 200): is_utf8=yes ╚ 195,136 Wide character in print at T:\test2.pl line 8. pack('C', 200): is_utf8=yes ╚ 200 Specifically, the first and last ought to be the same, and I shouldn't be getting that error. Seen on perl 5.8.3, 5.8.6 and 5.8.7. E.g., my current perl -v: This is perl, v5.8.7 built for MSWin32-x86-multi-thread (with 7 registered patches, see perl -V for more detail) Copyright 1987-2005, Larry Wall Binary build 813 [148120] provided by ActiveState http://www.ActiveState.com ActiveState is a division of Sophos. Built Jun 6 2005 13:36:37 TIA, Bob