HTML in utf8 and perl
From: Pawel Niewiadomski (niewiap_at_NOSPAM.widzew.net.INVALID)
Date: 02/28/04
- Next message: fifo: "Re: using sed from with a perl script"
- Previous message: gnari: "Re: Parameterformat falsch (parameter format not correct)"
- Next in thread: Alan J. Flavell: "Re: HTML in utf8 and perl"
- Reply: Alan J. Flavell: "Re: HTML in utf8 and perl"
- Reply: Andy Hassall: "Re: HTML in utf8 and perl"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 28 Feb 2004 13:02:24 +0000 (UTC)
I have been looking all over for an answer to this and haven't found a
satisfactory one. Please tell me what's going on. I want to write a perl
script generating an html page encoded in utf8. I was wondering why the
following code
#!/usr/bin/perl
binmode (STDOUT, ":utf8");
use charnames ':full';
printf "\N{CYRILLIC SMALL LETTER EF}\n";
printf "\x{d184}\n";
produces two characters encoded differently, although theoretically it
should generate two russian ef's identically encoded. The first character
is normaly visible in a browser (provided I set utf8 encoding) and the
second is not. Other than that, the second character is coded by three,
not two bytes, as I would expect. Changing :utf8 to :raw in the second
line only produces additional "Wide character in print at..." warnings
but doesn't change the general output. Writing printf "\xd1\x84\n" would
be a solution, but I am wondering what the problem here is with "\x
{d184}". If what I am asking has an obvious answer, please be so kind and
refer me to a sensible source of information.
Thanks very much in advance,
Pawel
- Next message: fifo: "Re: using sed from with a perl script"
- Previous message: gnari: "Re: Parameterformat falsch (parameter format not correct)"
- Next in thread: Alan J. Flavell: "Re: HTML in utf8 and perl"
- Reply: Alan J. Flavell: "Re: HTML in utf8 and perl"
- Reply: Andy Hassall: "Re: HTML in utf8 and perl"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|