Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^4: How to deal with malformed utf8 from XML parsing

by ribasushi (Monk)
on Jan 09, 2008 at 23:31 UTC ( #661528=note: print w/ replies, xml ) Need Help??


in reply to Re^3: How to deal with malformed utf8 from XML parsing
in thread How to deal with malformed utf8 from XML parsing

Well today was definitely a fruitful day. I learned about C0/C1 control codes which were the reason for google to complain. I also realized where this stuff actually comes from (someone pasting a mis-encoded chunk of text into a browser window). Finally I know not to use is_utf8 anymore :)
Thank you for your comments.

P.S.How I ended up fixing this:
$_ =~ s/[\x{80}-\x{9F}]/\x{FFFD}/g;
Comment on Re^4: How to deal with malformed utf8 from XML parsing
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2016-04-29 08:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    :nehw tseb si esrever ni gnitirW







    Results (439 votes). Check out past polls.