On Sat, 2010-04-24 at 15:38 +0200, Michiel Sikma wrote: > On 24 April 2010 14:45, Parham Doustdar <parham90@xxxxxxxxx> wrote: > > > Hi, > > > > I have created a PHP file, and wrote a string of Farsi letters in it. In > > the > > head section of the HTML, I put: > > > > <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"> > > > > There appears to be something wrong with Apache, or something, because no > > matter whether I put that string in an echo statement or just in an HTML > > with a php extention, the page loads as jibberish and I have to set the > > character encoding to UTF-8 manually in Firefox. > > > > Renaming that same file to .htm (when not using the echo statement), and > > loading it in the browser shows me the correct Farsi characters. > > > > Should I change something in Apache's settings for this to work? > > > > Thanks! > > > > > > No, that should work perfectly fine. Are you sure that the PHP file itself > is utf-8? > Could it be that you manually set the text encoding to something else in > your browser, causing it to remember that setting? > > Perhaps you could link us to the page itself so we can have a look. Note > that the best place to put that <meta> tag is right after the opening <head> > tag, before any other header information. > > Michiel If renaming the file as .htm shows the characters correctly, then the .php file is most likely saved as utf8. Maybe Apache has been instructed to send all HTML with another encoding, as it should send it out with the same encoding as the requested PHP script. Thanks, Ash http://www.ashleysheridan.co.uk