Bug #63426 [Opn->Ver]: Can't throw exceptions with accentued chars coded in latin1/ISO-8859-1
| From: | aharvey@php.net | Date: | Mon, 05 Nov 2012 03:44:41 +0000 |
| Subject: | Bug #63426 [Opn->Ver]: Can't throw exceptions with accentued chars coded in latin1/ISO-8859-1 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-174522@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=63426&edit=1
ID: 63426
Updated by: aharvey@php.net
Reported by: rick dot hjpbarcelos at gmail dot com
Summary: Can't throw exceptions with accentued chars coded in
latin1/ISO-8859-1
-Status: Open
+Status: Verified
Type: Bug
Package: *Unicode Issues
Operating System: Linux/Ubuntu 12.10
PHP Version: 5.4Git-2012-11-03 (snap)
Block user comment: N
Private report: N
New Comment:
I can verify this (CLI seems fine; Apache 2 handler isn't):
HTTP/1.1 200 OK
Date: Mon, 05 Nov 2012 03:44:20 GMT
Server: Apache/2.2.22 (Ubuntu)
X-Powered-By: PHP/5.4.9-dev
Vary: Accept-Encoding
Content-Length: 101
Content-Type: text/html;charset=iso-8859-1
<br />
<b>Fatal error</b>: in <b>/home/adamh/public_html/bugs/63426.php</b> on
line <b>5</b><br />
hexdump output shows that the entire "Uncaught exception" message is missing:
00000000 48 54 54 50 2f 31 2e 31 20 32 30 30 20 4f 4b 0d |HTTP/1.1 200 OK.|
00000010 0a 44 61 74 65 3a 20 4d 6f 6e 2c 20 30 35 20 4e |.Date: Mon, 05 N|
00000020 6f 76 20 32 30 31 32 20 30 33 3a 33 39 3a 30 31 |ov 2012 03:39:01|
00000030 20 47 4d 54 0d 0a 53 65 72 76 65 72 3a 20 41 70 | GMT..Server: Ap|
00000040 61 63 68 65 2f 32 2e 32 2e 32 32 20 28 55 62 75 |ache/2.2.22 (Ubu|
00000050 6e 74 75 29 0d 0a 58 2d 50 6f 77 65 72 65 64 2d |ntu)..X-Powered-|
00000060 42 79 3a 20 50 48 50 2f 35 2e 34 2e 39 2d 64 65 |By: PHP/5.4.9-de|
00000070 76 0d 0a 56 61 72 79 3a 20 41 63 63 65 70 74 2d |v..Vary: Accept-|
00000080 45 6e 63 6f 64 69 6e 67 0d 0a 43 6f 6e 74 65 6e |Encoding..Conten|
00000090 74 2d 4c 65 6e 67 74 68 3a 20 31 30 31 0d 0a 43 |t-Length: 101..C|
000000a0 6f 6e 74 65 6e 74 2d 54 79 70 65 3a 20 74 65 78 |ontent-Type: tex|
000000b0 74 2f 68 74 6d 6c 3b 63 68 61 72 73 65 74 3d 69 |t/html;charset=i|
000000c0 73 6f 2d 38 38 35 39 2d 31 0d 0a 0d 0a 3c 62 72 |so-8859-1....<br|
000000d0 20 2f 3e 0a 3c 62 3e 46 61 74 61 6c 20 65 72 72 | />.<b>Fatal err|
000000e0 6f 72 3c 2f 62 3e 3a 20 20 20 69 6e 20 3c 62 3e |or</b>: in <b>|
000000f0 2f 68 6f 6d 65 2f 61 64 61 6d 68 2f 70 75 62 6c |/home/adamh/publ|
00000100 69 63 5f 68 74 6d 6c 2f 62 75 67 73 2f 36 33 34 |ic_html/bugs/634|
00000110 32 36 2e 70 68 70 3c 2f 62 3e 20 6f 6e 20 6c 69 |26.php</b> on li|
00000120 6e 65 20 3c 62 3e 35 3c 2f 62 3e 3c 62 72 20 2f |ne <b>5</b><br /|
00000130 3e 0a |>.|
Previous Comments:
------------------------------------------------------------------------
[2012-11-03 22:07:50] rick dot hjpbarcelos at gmail dot com
Well, I don't know what could be... I installed PHP via apt-get, I'll try make a clean
install from another source...
------------------------------------------------------------------------
[2012-11-03 13:23:07] laruence@php.net
I can not reproduce this, both uncaught exception here(browser/bash).
thanks
------------------------------------------------------------------------
[2012-11-03 12:08:33] rick dot hjpbarcelos at gmail dot com
function exceptionHandler($e) {
echo $e;
}
set_exception_handler('exceptionHandler');
throw new Exception('é');
This way, it works, the message is shown.
------------------------------------------------------------------------
[2012-11-03 11:48:20] rick dot hjpbarcelos at gmail dot com
Description:
------------
Package 5.4.6-1ubuntu1
I don't really know why it's happening, started after I upgraded from version 5.3.4.
I tried to set the coding on browser (tested with Firefox and Chrome) and the problem didn't go
away.
Test script:
---------------
Code:
ini_set('display_errors', 1);
error_reporting(E_ALL);
header('Content-Type: text/html;charset=iso-8859-1');
throw new Exception("é");
Expected result:
----------------
Fatal error: Uncaught exception 'Exception' with message 'é' in
/home/henrique/public/teste.php:4 Stack trace: #0 {main} thrown in /home/henrique/public/teste.php
on line 4
Actual result:
--------------
On browser:
With xdegub:
( ! ) Fatal error: in /home/henrique/public/teste.php on line 4
( ! ) Exception: in /home/henrique/public/teste.php on line 4
Call Stack
# Time Memory Function Location
1 0.0002 124436 {main}( ) ../teste.php:0
Withou it:
Fatal error: in /home/henrique/public/teste.php on line 4
__________
On bash:
Stack trace:
#0 {main}
thrown in /home/henrique/public/teste.php on line 4
Fatal error: Uncaught exception 'Exception' with message '�' in
/home/henrique/public/teste.php on line 4
Exception: � in /home/henrique/public/teste.php on line 4
Call Stack:
0.0002 121256 1. {main}() /home/henrique/public/teste.php:0
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=63426&edit=1