Posted by:
dorian3d
(---.015-128-73746f39.cust.bredbandsbolaget.se)
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(""
;
?>
<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?