Bug #61980 [Com]: htmlentities and htmlspecialchars do not work with chinese!

From: Date: Wed, 09 May 2012 13:39:17 +0000
Subject: Bug #61980 [Com]: htmlentities and htmlspecialchars do not work with chinese!
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-170337@lists.php.net to get a copy of this message
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

« previous php.bugs (#170337) next »