Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: How to Fix Character Encoding Damaged Text Using Perl?

by Anonymous Monk
on Jun 15, 2013 at 02:29 UTC ( #1039062=note: print w/ replies, xml ) Need Help??


in reply to How to Fix Character Encoding Damaged Text Using Perl?

It's gibberish, not Chinese.

Then post the BYTES not unicode codepoints


Comment on Re: How to Fix Character Encoding Damaged Text Using Perl?
Re^2: How to Fix Character Encoding Damaged Text Using Perl?
by Anonymous Monk on Jun 15, 2013 at 02:32 UTC
    Whoops :)
    my $bytes = encode( 'UTF-8', $perlunicodestring ); $bytes =~ s{\x52\x65\x3A\x20\x55\x52\x47\x45\x4E\x54}{Re: URGENT}g
Re^2: How to Fix Character Encoding Damaged Text Using Perl?
by Jim (Curate) on Jun 15, 2013 at 02:51 UTC

    I posted the Unicode code points and character names to help illustrate how the character encoding damage occurred; that is, to demonstrate the pattern.

    My problem is straightforward:  Using Perl, restore the damaged text '敒剕䕇呎' to the original text 'Re: URGENT'.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1039062]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (14)
As of 2014-08-21 14:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (136 votes), past polls