SPUG: weired windows fonts

David Dyck david.dyck at fluke.com
Thu Nov 20 09:21:44 CST 2003


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 ].
>
> Windows "type" build-in command sees the file ok but perl
> apparently has some problem reading the file. Both vim and/or
> notepad think the file is ok.
>
> 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

>type foo.txt
this is foo.txt


>debug foo.txt
-d
1355:0100  FF FE 74 00 68 00 69 00-73 00 20 00 69 00 73 00   ..t.h.i.s. .i.s.
1355:0110  20 00 66 00 6F 00 6F 00-2E 00 74 00 78 00 74 00    .f.o.o...t.x.t.
1355:0120  0D 00 0A 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
1355:0130  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
1355:0140  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
1355:0150  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
1355:0160  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
1355:0170  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
-q


perl will print it like this

$ perl -ple '' foo.txt
ÿ_t h i s   i s   f o o . t x t



More information about the spug-list mailing list