perl-unicode

Re: is it utf8 or unicode?

2005-03-11 22:28:26
On Wed, 09 Mar 2005 20:03:08 +0000, 
unicode(_at_)ftumsh(_dot_)demon(_dot_)co(_dot_)uk said:

  > binmode FH1, ":raw";

Make this

   binmode FH1, ":utf8";

  > I don't understand what the [UTF8 "\x{c4}"]

"\x{x4}" is valid perl notation for the Unicode character 0xc4.

% perl -le '
my $data = "\xC4";
binmode STDOUT, ":utf8";
print $data ;
' | od -t x1
0000000 c3 84 0a
0000003

  > What's worse is that the output file contains xc4 and not
  > the utf-8 sequence I expected.

Because you chose :raw.

Hope this helps,
-- 
andreas

<Prev in Thread] Current Thread [Next in Thread>