Encode::DoubleEncodedUTF8 - Fix double encoded UTF-8 bytes to the correct one
use Encode; use Encode::DoubleEncodedUTF8; my $string = "\x{5bae}"; my $bytes = encode_utf8("\x{5bae}"); my $dodgy_utf8 = $string . $bytes; # $bytes is now double encoded my $fixed = decode("utf-8-de", $dodgy_utf8); # "\x{5bae}\x{5bae}"
Encode::DoubleEncodedUTF8 adds a new encoding utf-8-de and fixes double encoded utf-8 bytes found in the original bytes to the correct Unicode entity.
utf-8-de
The double encoded utf-8 frequently happens when strings with UTF-8 flag and without are concatenated. See encoding::warnings for details.
Tatsuhiko Miyagawa <miyagawa@bulknews.net>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
encoding::warnings, Test::utf8
To install Encode::DoubleEncodedUTF8, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Encode::DoubleEncodedUTF8
CPAN shell
perl -MCPAN -e shell install Encode::DoubleEncodedUTF8
For more information on module installation, please visit the detailed CPAN module installation guide.