Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^4: MIME::Parser::Filer and filenames in Simplified Chinese

by uxbod (Initiate)
on Nov 21, 2011 at 16:58 UTC ( [id://939259]=note: print w/replies, xml ) Need Help??


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

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"; }

Replies are listed 'Best First'.
Re^5: MIME::Parser::Filer and filenames in Simplified Chinese
by uxbod (Initiate) on Nov 21, 2011 at 17:10 UTC
    Actually I have just modified my test program to use Zwons code and that worked perfectly! Thank you so so much :)
Re^5: MIME::Parser::Filer and filenames in Simplified Chinese
by uxbod (Initiate) on Nov 21, 2011 at 17:40 UTC

    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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://939259]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-04-25 16:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found