Bug #61362 [Asn->Opn]: Exception::getTraceAsString, Exception::__toString not able to handle unicode

From: Date: Wed, 17 Jun 2015 14:43:30 +0000
Subject: Bug #61362 [Asn->Opn]: Exception::getTraceAsString, Exception::__toString not able to handle unicode
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-193616@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=61362&edit=1 ID: 61362 Updated by: johannes@php.net Reported by: sam at rmcreative dot ru Summary: Exception::getTraceAsString, Exception::__toString not able to handle unicode -Status: Assigned +Status: Open Type: Bug Package: Unicode Engine related Operating System: All PHP Version: 7.0.0 -Assigned To: johannes +Assigned To: Block user comment: N Private report: N Previous Comments: ------------------------------------------------------------------------ [2015-06-17 14:17:15] cmb@php.net See <http://3v4l.org/ONJBe>. As of PHP 5.4.29 the result is correct, but master shows a regression. The problem is that c is declared as char[1], what is a signed value, but the following calculations assume it is unsigned. Simply declaring unsigned char c = s[i]; should solve the problem. I'm working on a PR (including a respective test). [1] <http://lxr.php.net/xref/PHP_TRUNK/Zend/zend_exceptions.c#402> ------------------------------------------------------------------------ [2012-03-14 17:20:50] tony2001@php.net The problem is here: http://lxr.php.net/opengrok/xref/PHP_5_4/Zend/zend_exceptions.c#391 Dunno what to do in this case: either add to the docs that the result of getTraceAsString() is perfectly safe from binary symbols or drop that code completely and allow any chars there. ------------------------------------------------------------------------ [2012-03-14 15:16:42] sam at rmcreative dot ru It's UTF8 already. ------------------------------------------------------------------------ [2012-03-14 15:14:58] tony2001@php.net Nevermind, I see the problem. ------------------------------------------------------------------------ [2012-03-14 12:20:41] tony2001@php.net What if you try to switch your browser encoding to UTF8 from whatever it is by default? ------------------------------------------------------------------------ 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 https://bugs.php.net/bug.php?id=61362 -- Edit this bug report at https://bugs.php.net/bug.php?id=61362&edit=1

« previous php.bugs (#193616) next »