arivu198314 has asked for the wisdom of the Perl Monks concerning the following question:

My input is coming like encode(encode()), means double time encoded string, and it want to check wheter it is encoded double time or single time with UTF-8 format.

Replies are listed 'Best First'.
Re: Encode double time
by Corion (Patriarch) on Dec 15, 2011 at 15:07 UTC

    See Mojibake for modules and routines that deal with this.

Re: Encode double time
by Khen1950fx (Canon) on Dec 15, 2011 at 16:13 UTC
    This will make sure that it's proper UTF-8:
    #!/usr/bin/perl -slw use strict; use warnings; use Encoding::FixLatin qw(fix_latin); my $mixed_string = "L\x{e9}on L\xc3\xa9on"; my $utf8_string = fix_latin($mixed_string); binmode STDOUT, ':encoding(UTF-8)'; print $utf8_string;