http://qs321.pair.com?node_id=234426


in reply to work with unicode data and regexps

open FILE,'<:UTF-16','../perl/testproto/Protokoll.log')

or

binmode FILE,':UTF-16'

If you know the encoding of the file, you can tell Perl what it is, and it will act accordingly. Otherwise, it assumes it is 1 byte = 1 character, and fail on several multi-byte (or variable-length) encodings.

Note: I wrote UTF-16 above since you said you got 'NULs after every character'. You should check if it is indeed UTF-16, or maybe UCS-2 (they're not the same, you know...), or even something else.

-- 
        dakkar - Mobilis in mobile