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

 ID:                 61980
 Comment by:         info at phpjunkyard dot com
 Reported by:        yyb8 at vip dot qq dot com
 Summary:            htmlentities and htmlspecialchars do not work with
                     chinese!
 Status:             Open
 Type:               Bug
 Package:            Unknown/Other Function
 Operating System:   windows 2003
 PHP Version:        5.4.3
 Block user comment: N
 Private report:     N

 New Comment:

Having the same problem with Windows-1250 chars:

<?php
echo PHP_VERSION . '<br />' . PHP_EOL;
echo 'Testing: ' . htmlentities('ščćžđ ŠČĆŽĐ') . '<br />' . PHP_EOL;
echo 'Testing: ' . htmlspecialchars('ščćžđ ŠČĆŽĐ') . '<br />' . 
PHP_EOL;
echo 'Testing: ' . substr('ščćžđ ŠČĆŽĐ', 0) . '<br />' . PHP_EOL;
?>

substr works fine, htmlentities and htmlspecialchars don't return anything.

Affected: PHP 5.4.X
Works fine in 5.3.X and previous.

Sincerely,

Klemen


Previous Comments:
------------------------------------------------------------------------
[2012-05-09 10:42:10] yyb8 at vip dot qq dot com

Description:
------------
htmlentities and htmlspecialchars do not work with chinese!

$str='<a href="test.html">测试页面</a>';
 
echo htmlentities($str);

print nothing.

it is a bug?

Test script:
---------------
$str='<a href="test.html">测试页面</a>'; 
echo htmlentities($str);




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



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

Reply via email to