in reply to Printing a UTF8 code
print FO "\x{00b9}"; Outputs a strange characterWith no :encoding layer set on the file handle, Perl outputs characters with codes below 0x100 directly as bytes. This is done for byte transparency (to allow strings to consist of arbitrary bytes) and backwards compatibility:
$ perl -e 'print "\x{00b9}"' | hd 00000000 b9 |.| ^^-- notice the literal byte 0xB9 $ perl -CO -e 'print "\x{00b9}"' | hd 00000000 c2 b9 |..| ^^^^^-- this is the UTF-8 byte sequence for U+00B9
In Section
Seekers of Perl Wisdom