perl-unicode

Strange "UTF-8" problem

2004-04-12 18:30:10
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     orasnita(_at_)fcc(_dot_)ro

<Prev in Thread] Current Thread [Next in Thread>