perl-unicode

Re: Mixing Unicode and Byte output on a Unicode enabled Perl 5.8.0

2003-10-09 03:30:04
Hi Frank,

Frank Smith wrote:
I am trying to use the £ (pound sterling) symbol in a script that produces both TEXT 
and HTML the html handles the Unicode fine, all the browsers seem to work. However, once 
the text file arrives on the Windowz box the Unicode £ screws Excel.

What do you mean by "screw"? Blue screen? Error? Replacement characters?

Something that might help: Newer Windows systems follow the convention that a BOM (Byte Order Mark) at the beginning of a file signifies UTF-8 encoding. It might help if you do a

        use utf8;
        print HANDLE chr 0xfeff;

before beginning the regular output.

BTW, Windows editors also insert that BOM at the beginning when writing XML files encoded in UTF-8. In other words: If you edit a UTF-8 XML file with Windows Notepad, it will be corrupted. MSIE and Mozilla (!) still treat it as well-formed XML but a standards compliant parser will of course reject it.

Ciao

Guido
--
Imperia AG, Development
Leyboldstr. 10 - D-50354 Hürth - http://www.imperia.net/