Edit report at https://bugs.php.net/bug.php?id=62351&edit=1

 ID:                 62351
 Comment by:         alexander dot stehlik at gmail dot com
 Reported by:        php at sebastianmendel dot de
 Summary:            UTF-8 chars fail to be printed out properly with
                     zend.multibyte
 Status:             Open
 Type:               Bug
 Package:            Unicode Engine related
 Operating System:   GNU/Linux
 PHP Version:        5.4.4
 Block user comment: N
 Private report:     N

 New Comment:

I'm not sure if this issue is related but here is the problem I have with 
declare(ENCODING = 'utf-8'):

Tested PHP Versions:
PHP 5.4.6-1ubuntu1.1 (cli)
PHP 5.4.6-1ubuntu1.1 (cgi-fcgi)

Put this in a file (test.php):

<?php
declare(ENCODING = 'utf-8') ;

//ä ü ö

?>

Run php test.php > test.txt

In text.txt you can find some unreadable characters.

This always occurs if there are special chars in any COMMENTS in the PHP file.


Previous Comments:
------------------------------------------------------------------------
[2012-12-05 09:46:06] bukin242 at yandex dot ru

Please fix in the new versions of php

------------------------------------------------------------------------
[2012-06-18 15:18:20] php at sebastianmendel dot de

Description:
------------
Enabling zend.multibyte and having declare(encoding = UTF-8) in UTF-8 encoded 
scripts does not print UTF-8 chars properly.

Same script (still encoded as UTF-8) but with declare(encoding = ISO-8859-1) 
prints out UTF-8 chars correct.

>/opt/phpfarm/inst/bin/php-5.4.4 -i | grep multi
zend.multibyte => On => On

>/opt/phpfarm/inst/bin/php-5.4.4 -i | grep UTF
default_charset => UTF-8 => UTF-8
zend.script_encoding => UTF-8 => UTF-8
exif.encode_unicode => UTF-8 => UTF-8
iconv.input_encoding => UTF-8 => UTF-8
iconv.internal_encoding => UTF-8 => UTF-8
iconv.output_encoding => UTF-8 => UTF-8
LANG => de_DE.UTF-8
_SERVER["LANG"] => de_DE.UTF-8

Test script:
---------------
<?php
declare(encoding = 'UTF-8');
echo htmlspecialchars('"aäaß', ENT_QUOTES | ENT_IGNORE, 'UTF-8');
echo "\n" . '"aäaß';
?>




Expected result:
----------------
&quot;aäaß
"aäaß

Actual result:
--------------
&quot;aa
"a▒a▒


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



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

Reply via email to