in reply to Re: Slightly OT - Matching a strange character
in thread Slightly OT - Matching a strange character

Right -- though a hex dump tends to be more useful in cases like this. And of course, if the odd byte happens to be near the end of a large file, this approach can be tedious...

Here's my favorite -- it prints a histogram of byte values in a data stream or file:

#!/usr/bin/perl use strict; my @ch; while (<>) { $ch[ord()]++ for ( split( // )); } printf "%6d %.2x\n", $ch[$_], $_ for ( grep {$ch[$_]} 0..$#ch );
And it would be easy to make a couple additions/alterations so that it tabulates utf8 characters instead of bytes.