in reply to Find illegal ASCII characters
#!/usr/bin/perl undef $/; while (<>) { print "File $ARGV has ", length(), " total length\n"; while (/([^\n\r\x20-\x7f])/g) { print "File $ARGV has character ", ord($1), " at byte ", pos()-1, +"\n"; } print "File $ARGV has ", tr/\n//, " total lines\n"; }
-- Randal L. Schwartz, Perl hacker
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: •Re: Find illegal ASCII characters
by Anonymous Monk on Mar 07, 2002 at 22:40 UTC | |
by demerphq (Chancellor) on Mar 08, 2002 at 19:09 UTC | |
by Juerd (Abbot) on Mar 08, 2002 at 20:05 UTC | |
by IlyaM (Parson) on Mar 09, 2002 at 01:06 UTC | |
by Juerd (Abbot) on Mar 09, 2002 at 01:48 UTC |
In Section
Code Catacombs