
May 1st, 2005, 06:32 AM
|
|
|
|
Join Date: Apr 2007
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Ensure server returns UTF-8 using PHP
Hi,
I've set the .htacess file on my web server to deliver UTF-8 HTML files to the browser properly.
But I need to know how to do this for .php files as all the files that are being delivered as PHP are *not* recognised as UTF-8. Even though they are truly in UTF-8 and have the charset set in the metatag to "UTF-8.
So no browser can read any pages that I'm returning that use Japanese characters. Although if you set the browser to UTF-8 explicitly, it will work. But you have to do that for every single page in IE and Firefox (kudos to Opera which remembers the setting).
For HTML files I do this:
AddType text/html;charset=utf-8 .html .htm
But I can't work out what to put for .php files to get it to work.
I tried:
AddType text/html;charset=utf-8 .html .htm .php
But it didn't work. In fact the result was disasterous - maybe you can tell. Maybe I'm missing something.
|