#!/usr/bin/perl -w # Find all characters used in uuencode table. # # 2014-03-08 use strict; # Collect all possible output bytes from uuencoded text sub GetUUCharset($) { my ($charset) = @_; for(my $i = 0; $i < 256; $i++) { for(my $j = 0; $j < 256; $j++) { my $uu = pack 'u*', chr($i) . chr($j); foreach my $byte (unpack 'C*', $uu) { $$charset{$byte} = 1; } } } } # Output keys in character set sub OutputCharset($) { my ($charset) = @_; foreach (sort {$a <=> $b} keys %$charset) { printf '0x%02x 0%03o %3d %c'."\n", $_, $_, $_, $_; } } my %charset = (); GetUUCharset(\%charset); OutputCharset(\%charset);