adamvagyok has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I have the following code (saved in UTF-8 format, using Notepad++):
But it says the following error message:#!/usr/bin/perl use strict; use warnings; use encoding "cp852"; use utf8; my $a="aáaxBy"; $a =~ /(.*?)x(A*)y/;
Malformed UTF-8 character (unexpected continuation byte 0xa1, with no +preceding start byte) in pattern match (m//) at c:\Perl\work\gi\utfte +st.pl line 9.
I just don't understand why and how to get rid of it. How can a malformed string be in a UTF-8 saved text file?
Thanks for your help in advance,
Adam
P.S. I need the two "use"-s, because otherwise I wasn't able to print out something like "áéíó" to terminal.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: UTF-8 problem (malformed...)
by ikegami (Patriarch) on Dec 27, 2009 at 23:37 UTC | |
by Anonymous Monk on Dec 27, 2009 at 23:40 UTC | |
|
Re: UTF-8 problem (malformed...)
by Anonymous Monk on Dec 27, 2009 at 22:57 UTC | |
by adamvagyok (Novice) on Dec 27, 2009 at 23:00 UTC |