Strange "UTF-8" problem

[email protected] ("Octavian Rasnita")
Newsgroups perl.unicode
Message-ID <[email protected]>
Hello all,

I have received the following error:
Malformed UTF-8 character (unexpected end of string) at -e line 1, <I> line
2.

The one line script was:

perl -e 'open(I, "lang.lng"); while(<I>) {next if /^[\t ]*#/; next unless
/\w/; s/\s*$//; print;}'

The text file lang.lng was:
line1=mâta
lala=tâta

It is not a UTF-8 encoded file, but  a simple ANSI/Unix end of line file
that contains some special chars in latin1 character set.

The program works fine with Perl 5.8.3 under Red Hat, but it gives me that
error if running it on another system where I have perl 5.8.0. However, I
guess this has nothing to do with the version of perl....

Help! Do you have any idea what's the problem?

Thank you.

Teddy,
teddy.fcc.ro     [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.