ID: 29318
Comment by: atlantisboy at yougotmail dot com
Reported By: atlantisboydn at yougotmail dot com
Status: Open
Bug Type: mbstring related
Operating System: Windows XP SP1
PHP Version: 5.0.0
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[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.
------------------------------------------------------------------------
[2004-07-23 03:30:52] [EMAIL PROTECTED]
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php
If you can provide more information, feel free to add it
to this bug and change the status back to "Open".
Thank you for your interest in PHP.
<?php
$escaped = html_entity_decode('€aä',
ENT_QUOTES, 'UTF-8');
var_dump($escaped);
var_dump(mb_convert_encoding($escaped, 'HTML-ENTITIES',
'UTF-8'));
?>
string(6) "�a�"
string(13) "€aä"
Works fine here.
------------------------------------------------------------------------
[2004-07-22 11:08:55] atlantisboydn at yougotmail dot com
Description:
------------
The following script works fine with PHP 4.3.x, but the returned string
don't output in HTML-Entities format in PHP 5.0.0
$str = mb_convert_encoding($str, "HTML-ENTITIES","UTF-8");
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=29318&edit=1