in reply to Re^2: MIME::Parser::Filer and filenames in Simplified Chinese
in thread MIME::Parser::Filer and filenames in Simplified Chinese

comes out as where? Showing correctly where?

Does the program produce the correct bytes?

  • Comment on Re^3: MIME::Parser::Filer and filenames in Simplified Chinese

Replies are listed 'Best First'.
Re^4: MIME::Parser::Filer and filenames in Simplified Chinese
by uxbod (Initiate) on Nov 21, 2011 at 16:58 UTC
    Here is some test code I am using to try and resolve the problem
    #!/usr/bin/perl use Encode; use Encode::CN; use Encode::TW; use MIME::EncWords qw ( /decode_mimewords/); binmode STDOUT, ":utf8"; my $text = "=?gb2312?B?RFBNMjAwN2V4Y2hhbmdl64rgXcVj4F3P5NDej80uemlw?=" +; my(@chunks) = decode_mimewords($text); for my $pair (@chunks) { my($data,$encoding) = @$pair; my $filename = Encode::decode($encoding,$data); print $filename . "\n"; }
      Actually I have just modified my test program to use Zwons code and that worked perfectly! Thank you so so much :)

      Spoke to soon :( Even though it is decoded correctly when displayed if you dump the output one sees

      DPM2007exchange電郵與郵箱修復.zip

      $VAR1 = "DPM2007exchange\x{96fb}\x{90f5}\x{8207}\x{90f5}\x{7bb1}\x{4fee}\x{5fa9}.zip";

      This the does not match the physical file that resides on the server. How can one get them to be the same ?
        They are the same, it's just Dumper escapes unicode characters.