in reply to How to read a Unicode file?

Chances are that if ASCII is turning up with interposed zero bytes, your file is in utf16. That is the default encoding on Windows.

Perl 5.8 is pretty smart about unicode.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re: Re: How to read a Unicode file?
by ibanix (Hermit) on Jan 24, 2004 at 00:05 UTC
    Thanks for the UTF-16 tip. I found that

    open(FILE, "<:encoding(UTF-16LE)", $file)

    did the magic for me.

    $ echo '$0 & $0 &' > foo; chmod a+x foo; foo;