PDA

View Full Version : PHP and UTF-8 BOM



Lucent
07-30-2005, 12:29 AM
PHP has problems with UTF-8 files that begin with a byte order mark. If you include() a file that's UTF-8, it'll include the byte order mark and insert garbage into the page. I've investigated, and the fix is to configure PHP with --enable-zend-multibyte. Could this be done?

Reference: http://bugs.php.net/bug.php?id=22108

shw
12-03-2005, 09:52 AM
This problem has had us scratching our heads for a long time now. Thanks for the solution. Now it is just to see if it will work!

Simon

WestHost - RMinnick
12-05-2005, 08:45 AM
What version of PHP are you using? Our latest releases of PHP ( 4.4.0, 4.4.1 and 5.0.5 ) were all compiled with the --enable-zend-multibyte option. If you aren't using one of those versions I would recommend upgrading and that should solve your problem.

shw
12-07-2005, 04:57 PM
We are using 5.0.3. We thought that maybe the problem was with v.5 and were on the point of uninstalling this and reinstalling 4.4.1. This might then not be the solution to the problem.

As well as getting 3 rubbish characters at the start of a file we are also getting blanks in the unicode MySql database, so we are also on the point of uninstalling this and reinstalling MySql 3.23. We are elsewhere putting unicode into a v. 4.0 (ASCII) database with no problems. But we are having many problems with v. 4.1 (unicode) on our VPS. So now we are on the point of working our way backwards until we reach a point were things again work as they should.

The problem has to be PHP or MySql. What else could it be? Our php scripts for uploading data into the v. 4.0 and 4.1 databases are the same!
One alternative is that MySql 4.1 is buggy. When will v. 5 be available on westhost? Maybe this version would solve our problems.

Simon

WestHost - RMinnick
12-08-2005, 09:21 AM
PHP 5.0.5 is currently available and is compiled with the --enable-zend-multibyte option. If you don't see 5.0.5 in your Site Applications, send your domain name to me in a private message and I'll check into it.

shw
12-08-2005, 07:08 PM
I have seen that php 5.0.5 is now available to install. We will try that first. Hope this does the trick. Thanks for the information.

Simon

LWC
12-21-2005, 07:14 PM
Moved to http://forums.westhost.com/showthread.php?p=30121