in reply to Re: Why does Encode::Repair only correctly fix one of these two tandem characters?
in thread Why does Encode::Repair only correctly fix one of these two tandem characters?
I think the right-to-left pipeline I used to damage the characters for the purpose of the demonstration…
# <-- 3 <-- 2 <-- 1 $foo = encode('UTF-8', decode('Windows-1252', encode('UTF-8', $foo)));
…more clearly emulates what actually happens in the wild: text is encoded in UTF-8, then wrongly decoded as if it were encoded in Windows-1252, then encoded again in UTF-8. I'm not sure what using the in-place convenience function Encode::from_to() lends to the clarity and effectiveness of the demonstration of the sequence of events.
FWIW, Encode::Repair uses Encode::encode() and Encode::decode(), not Encode::from_to().
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Why does Encode::Repair only correctly fix one of these two tandem characters?
by remiah (Hermit) on Aug 11, 2014 at 02:05 UTC | |
by Jim (Curate) on Aug 11, 2014 at 02:26 UTC |
In Section
Seekers of Perl Wisdom