richard_mortimer has asked for the wisdom of the Perl Monks concerning the following question:

Greetings Perl Monk People, I've been asked to decrypt and unescape MIME headers that ar written to our log file. These are encoded in the Blowfish encryption algorhythm, and look something similar to this:
$tmp ="IPPQY%FF%B3M/%u2030%u2014s%FE%07%8D%1E%D3%27j ... [snip]";
The problems are encountered when the UTF16 character (eg %u2030) are encountered, which are not correctly unescaped back to the character they are meant to represent. Am I using the correct module for this function? Or am I better to write a series of Regex's that do something like:
$tmp2 =~ s/\%u2030/\x137/gi;
If the latter is the case, could someone point me to a URL that lists these codes and their appropriate hex values. Thanks for your time - my sanity can still be saved ... !! Richard

Replies are listed 'Best First'.
Re: Decoding MIME headers with URI::Escape for extended character set
by hawtin (Prior) on Apr 01, 2003 at 08:16 UTC

    Your best bet may be to uuencode the data before writing it and uudecode the data after reading it. Look at pack("u",...) and unpack("u",...) (I normally have to mess with string lengths when I do it).

    This will ensure that all data is encoded into 7 bit strings

Re: Decoding MIME headers with URI::Escape for extended character set
by Lhamo Latso (Scribe) on Apr 01, 2003 at 08:16 UTC

    If you are looking for the Unicode charts, they are located at Unicode Charts.

    Sorry I can't be more help.