in reply to Converting ascii to numbers
If you ever want to get the data back though, this is a bad encoding. For instance do you decode "64" as chr(6).chr(4) or just chr(64)? Maybe you should pad out the ASCII values to 3 digits (though probably won't work with some wide unicode characters)$x =~ s/(.)/ord $1/egs;
Then to get the characters back:$x =~ s/(.)/sprintf "%03d", ord $1/egs;
$x =~ s/(\d{3})/chr $1/g;
blokhead
|
|---|