Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Encode double time

by arivu198314 (Sexton)
on Dec 15, 2011 at 15:03 UTC ( [id://943755]=perlquestion: print w/replies, xml ) Need Help??

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;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://943755]
Approved by RedElk
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-04-19 17:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found