#Example 1: native string may not be native string #Code: $native_string=pack('W*', unpack('U*', $unicode_string)); use strict; use warnings; use Encode qw(encode); use Devel::Peek; use 5.012; my($code_point,$unicode_string,$native_string, $native_string2); $code_point=0x41;#"A"; $unicode_string=pack('U*', $code_point); $native_string=pack('W*', unpack('U*', $unicode_string)); Dump $unicode_string; Dump $native_string; # ==> here it is not UTF-8 flagged $code_point=0x3042;#HIRAGANA LETTER A $unicode_string=pack('U*', $code_point); $native_string=pack('W*', unpack('U*', $unicode_string)); $native_string2=Encode::encode('utf8', $unicode_string); Dump $unicode_string; Dump $native_string; # ==> this is UTF8 flaged may be transparently upgraded because code point > 255 Dump $native_string2;