ID: 29318
Updated by: moriyoshi@php.net
Reported By: atlantisboydn at yougotmail dot com
-Status: Open
+Status: Feedback
Bug Type: mbstring related
Operating System: Windows XP SP1
PHP Version: 5.0.0
New Comment:
Hi there.
(1) $a = mb_convert_encoding($a, 'UTF-8','SJIS');
(2) $a = mb_convert_encoding($a, 'HTML-ENTITIES','UTF
-8');
Assuming you got correct result from example (1), you
seem to be converting a sequence of SJIS-encoded data
into HTML-ENTITIES while setting the source encoding to
"UTF-8" in example (2), which will never produce correct
result.
It may be a bit too late to say, though...
Previous Comments:
------------------------------------------------------------------------
[2004-08-02 18:08:09] ross at golder dot org
This sounds like a duplicate of :
http://bugs.php.net/bug.php?id=25670
I'm still struggling with this one.
------------------------------------------------------------------------
[2004-07-31 12:49:04] atlantisboy at yougotmail dot com
I really don't why noone consider this bug ???
------------------------------------------------------------------------
[2004-07-31 12:41:17] johnmcklein at hotmail dot com
I also face this problem , how to fix it ?
------------------------------------------------------------------------
[2004-07-24 11:15:50] atlantisboy at yougotmail dot com
I also notice that , i retried many times with the same setting .
+Apache1.3.31 , PHP4.3.8
+Apache1.3.31 , PHP5.0.0
+Apache2 , PHP5.0.0
+Apache2 , PHP4.3.8
+Omni 3 Alpha 3 , PHP4.3.8
+Omni 3 Alpha 3 , PHP5.0.0
on Windows XP (SP1) computers and the problems still remain the same
when i use PHP5.0.0 . I believe it's a bug and hope the problem will be
resolved.
------------------------------------------------------------------------
[2004-07-23 15:09:16] atlantisboydn at yougotmail dot com
$mbstring_cfgs = array(
'zlib.output_compression' => '1',
'zlib.output_compression_level' => '9',
'mbstring.detect_order' => 'UTF-8',
'mbstring.http_input' => 'UTF-8',
'mbstring.http_output' => 'UTF-8',
'mbstring.internal_encoding' => 'UTF-8',
'mbstring.script_encoding' => NULL,
'mbstring.substitute_character' => NULL
);
foreach( $mbstring_cfgs as $k => $v )
{
ini_set ($k,$v);
}
$a = @$_POST['txt'];
$a = mb_convert_encoding($a, 'UTF-8','SJIS');
$a = mb_convert_encoding($a, 'HTML-ENTITIES','UTF-8');
echo $a;
=====================================================
Step One : Converting a SJIS encoded string to UTF-8 string . This step
is good , nothing trouble appeared.
Step Two : When convert UTF-8 string ( or whatever multi-byte string )
to HTML ENTITIES . PHP 5.0.0 return a wrong string with uncomplete
entities and strange characters.
I don't face this problem in PHP 4.3.3 RC3.
------------------------------------------------------------------------
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/29318
--
Edit this bug report at http://bugs.php.net/?id=29318&edit=1