in reply to Unicode and text files

Did you add "use utf8;" to the top of your script?

From the perlunicode help:
"use utf8 still needed to enable UTF-8/UTF-EBCDIC in scripts As a compatibility measure, the use utf8 pragma must be explicitly included to enable recognition of UTF-8 in the Perl scripts themselves (in string or regular expression literals, or in identifier names) on ASCII-based machines or to recognize UTF-EBCDIC on EBCDIC-based machines. These are the only times when an explicit use utf8 is needed"

<update>Which doesn't work for me... :(</update>

Tom Melly, tom@tomandlu.co.uk

Replies are listed 'Best First'.
Re^2: Unicode and text files
by dirtdart (Beadle) on Oct 12, 2006 at 13:41 UTC
    I hadn't been using utf8 because I didn't think that I really needed it with Perl 5.8. However, I just tried the same code with use utf8; added and nothing changed. The regular expression still doesn't match the appropriate line in the file and the line still prints as what appears to be a string of characters separated by spaces. This happens when opening the file with or without utf8 specified in the open statement.