in reply to Translating non-printable ascii

Here's one way to do it:
#!perl -w use strict; my @ddig; my @spaces; $ddig[$_ + 128] = sprintf "%02d", $_ for 0 .. 99; $spaces[$_] = " " x $_ for 0 .. 255; while (<DATA>) { s/([\x80-\xe3])/$ddig[ord($1)]/g; s/\xff(.)/$spaces[ord($1)]/eg; print; } __DATA__ MOBCAJ This is atest 123456789012345678901234567890
Please note, as Roy Johnson says above, that either your specification is unclear or your arithmetic is wrong. I'm assuming that "\x00-\xe3" maps to "00" through "99". The example you gives maps to "MO01B13CAJ35" with my code, not "MO01B12CAJ32".