SPUG: weired windows fonts (encoding(utf16))

Florentin Ionescu florentin_ionescu at yahoo.com
Sat Nov 22 15:21:11 CST 2003


On Thu, 20 Nov 2003, David Dyck wrote :

» Date: Thu, 20 Nov 2003 12:19:55 -0800 (PST)
» From: David Dyck <david.dyck at fluke.com>
» To: Florentin Ionescu <florentin_ionescu at yahoo.com>
» Cc: spug-list at mail.pm.org
» Subject: Re: SPUG: weired windows fonts (encoding(utf16))
»
» On Thu, 20 Nov 2003 at 07:21 -0800, David Dyck <david.dyck at fluke.com> wrote:
»
» > On Thu, 20 Nov 2003 at 00:16 -0800, Florentin Ionescu <florentin_ionescu at ya...:
» > > On windows XP , I encounter something strange - a file
» > > that contains, say a line
» > > [ this line ]
» > > is red by perl something like this
» > > [ t h i s  l i n e ].
» > >
» > > Does anybody please know/has idea on what goes wrong ?
»
» > The file is encoded in windows unicode format
» > If you create a file in notepad.exe and save it
» > using "save as" and set the Encoding to Unicode
» > you can create such a file as my foo.txt
» > perl will print it like this
»
» > $ perl -ple '' foo.txt
» > ÿ_t h i s   i s   f o o . t x t
»
» I really should have added that if you use perl 5.8 you can use
» perl5.8 -lwe "open FH, q(<:encoding(utf16)), q(foo.txt); while (<FH>) { print }"
» and get
» This is foo.txt
»

Thank you  everybody for help.  Indeed the file that created problems
was unicode encoded. Problem solved.





More information about the spug-list mailing list