#39244 [Bgs->Opn]: PHP can't read UTF-8 encoded PHP code
| From: | j dot hakvoort at publiceren dot net | Date: | Wed, 25 Oct 2006 12:08:07 +0000 |
| Subject: | #39244 [Bgs->Opn]: PHP can't read UTF-8 encoded PHP code | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-103960@lists.php.net to get a copy of this message | ||
ID: 39244
User updated by: j dot hakvoort at publiceren dot net
Reported By: j dot hakvoort at publiceren dot net
-Status: Bogus
+Status: Open
Bug Type: PCRE related
Operating System: Linux
PHP Version: 4.4.4
New Comment:
Ok, I found out that it's due to the folowing BUG in PHP......
UTF-8 encoded documents have 3 characters on top of the document wich
specify the UTF-8, this is called BOM.
These characters might be needed, but to get PHP working it would be
required to remove these characters.
The only solution to remove these characters I've found is by using
special editors. This will take a huge amount of time!
Is there no other solution for this?? Why doesn't PHP read UTF-8
encoded files???
Best Regards,
Jan Jaap Hakvoort
Previous Comments:
------------------------------------------------------------------------
[2006-10-24 09:55:58] tony2001@php.net
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
------------------------------------------------------------------------
[2006-10-24 08:55:58] j dot hakvoort at publiceren dot net
Description:
------------
Hi!
I've been working on the encoding issue to make a site compatible for
any language, but the problem is that when you print special characters
in PHP it will be malformed.
So the advice I received is to encode the PHP code to UTF-8, but when I
do this however the script will fail because PHP doesn't read UTF-8
encoded PHP code!
Is this a bug? I am using 4.4.4
Best Regards,
Jan Jaap Hakvoort
Reproduce code:
---------------
<?php
$str = 'éúïäç Ä';
$match = preg_match('¡[ ]+¡',$str);
?>
Expected result:
----------------
$match will be set to true.
Actual result:
--------------
PHP error, unexpected character [block]...
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39244&edit=1