ID:               36140
 Updated by:       [EMAIL PROTECTED]
 Reported By:      sugan_b at yahoo dot co dot in
-Status:           Analyzed
+Status:           Feedback
 Bug Type:         mbstring related
 Operating System: FC3
 PHP Version:      5.1.2
 Assigned To:      hirokawa
 New Comment:

Please test this code.
The string of first argument should be encoded in the internal encoding
(EUC-JP in this case.) .
You should not convert the string into ISO-2022-JP
using mb_convert_encoding()

php.ini:
 mbstring.language = Japanese
 mbstring.internal_encoding = EUC-JP

sample.php:
<?php
$msg ="some euc-jp encoded japanese string.";
$sub_mime = mb_encode_mimeheader($msg,"ISO-2022-JP","B","\r\n");
echo $sub_mime;
?>



Previous Comments:
------------------------------------------------------------------------

[2006-04-10 13:07:09] [EMAIL PROTECTED]

Rui, this might be good candidate for fixing. :)

------------------------------------------------------------------------

[2006-02-17 11:15:42] sugan_b at yahoo dot co dot in

Sorry for the late response.
This is my understanding. Please correct me if i am wrong.
The mb_encode_mimeheader function is doing base64 encoding process in
mbfilter.c. base64 encoding encodes from the front by each 3bytes of
the object character and if the
length of character has no more 3bytes, it converts the rest 1 or 2
bytes into "=", value "0x3d". mb_encode_mimeheader is actually doing
this process but According to RFC2047, A long
word exceeds 75bytes should be expressed by multiple lines. 
mb_encode_mimeheader does not care about this line separating action
and thus the bit value of encoded character is misencoded and sent to
mail receiver incorrectly.

I think that is the reason for  the subject value to get garbled.

------------------------------------------------------------------------

[2006-02-06 15:09:18] [EMAIL PROTECTED]

Could you please check it by the simpler script ?

php.ini:
 mbstring.language = Japanese
 mbstring.internal_encoding = EUC-JP

sample.php:
<?php
$subject ="some euc-jp encoded japanese string.";
$encoded= mb_convert_encoding($subject, "ISO-2022-JP", "EUC-JP");
$sub_mime = mb_encode_mimeheader($encoded, "ISO-2022-JP", "B","\r\n");
echo $sub_mime;
?>
It works well or  not ?
If the result is a correct MIME encoded string, 
mb_encode_mimeheader() work fine.


------------------------------------------------------------------------

[2006-01-25 10:58:04] [EMAIL PROTECTED]

Rui, can you check this out please?

------------------------------------------------------------------------

[2006-01-24 12:18:54] sugan_b at yahoo dot co dot in

The actual result obtained is:
&#12304;&#21839;&#21512;&#12305;
&#12513;&#12540;&#12523;&#12398;Subject&#12364;8;z2=$1$7$F$7$^$$$^$9

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/36140

-- 
Edit this bug report at http://bugs.php.net/?id=36140&edit=1

Reply via email to