Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re: ASCII, Unicode, use utf8: My Story of Discovery

by richardX (Pilgrim)
on Nov 04, 2002 at 04:13 UTC ( #210118=note: print w/replies, xml ) Need Help??

in reply to ASCII, Unicode, use utf8: My Story of Discovery

I have had my log parsing routines crash because of invalid ASCII characters, so I run this code against it, which cleans up the bad boys found.
# loop through the file zapping the bad characters found while(<FILE>) { $lineBuff = $_; # remove upper ascii $lineBuff =~ s/([\x7F-\xFF]+)/$delimiter/gm; # remove lower ascii $lineBuff =~ s/([\x00-\x1F]+)/$delimiter/gm; $lineBuff =~ s/\%//gm; # send the clean data to the output file print OUT "$lineBuff\n"; }


There are three types of people in this world, those that can count and those that cannot. Anon

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2016-10-26 09:44 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (338 votes). Check out past polls.