[i18n] IMP4 japanese subject problem

Hiromi Kimura hiromi at tac.tsukuba.ac.jp
Mon Feb 21 23:51:42 PST 2005


Problem: viewing of japanese subject strings collaped sometimes
   (in mailbox view and message view)

Reason:
  Japanese mails uses iso-2022-jp(7 bit) encoding, for example;
    Subject: =?ISO-2022-JP?B?GyRCJSYlIyVrJTk2bj18GyhC?=

  This string is decoded by decode() in horde/lib/Horde/MIME.php;
       (line 351)
        case 'B':
        case 'b':
            $decoded = urldecode(base64_decode($encoded_text));
            $decoded = String::convertCharset($decoded, $charset, $to_charset);

  The result string of base64_decode() is;
    esc $ B % & % # % k % 9 6 n = | esc ( B    (18 bytes total)
                        ^ ^ ^
  these '%9' and '6n' repesent japanese characters,
  but urldecode() convert '%96' to another one !!

  So, urldecode() is not need for iso-2022-jp encoding.

Regards,
-=-=-=-=-
Hiromi Kimura, Tandem Accelerator Complex, University of Tsukuba, JAPAN
PGP Fingerprint16 = 2A 27 2E 46 9E 75 4E 3D  E3 FD 5A DC 2A AA 3A 2E


More information about the i18n mailing list