WampServer does not cope well with UTF-8
Posted by: dorian3d (---.015-128-73746f39.cust.bredbandsbolaget.se)
Date: September 30, 2007 06:11PM

WAMP5 Version 1.6.6

Hi, I have found a problem with PHP files encoded in UTF-8 running under Wamp.
I have this code in a PHP file, encoded with UTF-8:
Quote

<?php

header(""winking smiley;

?>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
</head>
<body>
Hello
</body>
</html>

And the result is:

Quote

Warning: Cannot modify header information - headers already sent by (output started at D:\Web\Manzana\www\public_html\faa.php:1) in D:\Web\Manzana\www\public_html\faa.php on line 3
Hello

This is because in the generated code, there are three garbage bytes in the beginning of the file (0xEF, 0xBB, 0xBF) and the header is sent after them. I think they appear always that a <?php tag is reached.

All this leads me to think the initial configuration of the php.ini or the httpd.conf does not take into account the UTF encoding. However, I have tried changing some values related to charsets in these files, but I have achieved nothing. So, might this be a WampServer problem? Or something wrong with my configuration?

Options: ReplyQuote
Re: WampServer does not cope well with UTF-8
Posted by: dorian3d (---.015-128-73746f39.cust.bredbandsbolaget.se)
Date: October 02, 2007 08:43PM

I found out the solution. Chech this: [bugs.php.net]

You can solve this by changing the php.ini. Change the following line:
output_buffering = Off
by this one:
output_buffering = 4096

Options: ReplyQuote
Re: WampServer does not cope well with UTF-8
Posted by: dorian3d (---.015-128-73746f39.cust.bredbandsbolaget.se)
Date: October 02, 2007 10:18PM

Well, above is not a solution, only a work-around.
The problem do dissapear if you change the charset of the file from UTF-8 to UTF-8 without BOM.

Options: ReplyQuote


Sorry, only registered users may post in this forum.