php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24106 UTF8 to SJIS bug
Submitted: 2003-06-10 02:00 UTC Modified: 2006-09-14 22:39 UTC
From: richard at enfour dot co dot jp Assigned: hirokawa (profile)
Status: Not a bug Package: mbstring related
PHP Version: 4.3.2 OS: Linux
Private report: No CVE-ID: None
 [2003-06-10 02:00 UTC] richard at enfour dot co dot jp
It maybe elsewhere but I found a case where UTF-8 to 
SJIS mb_convert_encoding mashes a Japanese text string.

The string is the kanji for "souseki"
Unicode:
U8e2a+8de1

In SJIS it should be:
E748+90D5
but gets mashed.

EUC works...

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-28 09:16 UTC] hirokawa@php.net
I tested by a tiny script using PHP 4.3.3RC1 on Windows2000,
<?php
 $str_ucs2 = sprintf("%c%c%c%c",0x8e,0x2a,0x8d,0xe1);
 echo mb_convert_encoding($str_ucs2, "SJIS", "UCS2");
?>
the output byte code is E748+90D5, as you are expecting.
I think it works fine.



 [2003-06-30 07:45 UTC] hirokawa@php.net
I tested also on Linux using PHP 4.3.3RC1.

<?php
 $str_ucs2 = sprintf("%c%c%c%c",0x8e,0x2a,0x8d,0xe1);
 echo mb_convert_encoding($str_ucs2, "SJIS", "UCS2");
?>
the output byte code is E748+90D5, as you are expecting.
I think it works fine.
 [2006-09-14 22:39 UTC] hirokawa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php


 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Sep 23 19:03:37 2021 UTC