![]() |
|
good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Malformed UTF-8 characterby ikegami (Patriarch) |
on Nov 30, 2022 at 14:08 UTC ( #11148459=note: print w/replies, xml ) | Need Help?? |
That indicates a scalar which become corrupted when Perl or XS code improperly decoded a string. For example, use utf8; doesn't validate if the source code is actually valid UTF-8, and produces corrupt scalars if it's not.
(Fortunately, use utf8; catches the problem and bails.) Are you using use utf8; with a source file that isn't encoded using UTF-8? The likely culprit is a U+2013 EN DASH ("–") encoded using cp1252. Using the :utf8 encoding layer can also produce corrupt scalars.
That's why :encoding(UTF-8) should be used instead.
In Section
Seekers of Perl Wisdom
|
|