Submitted by seattleserver on Wed, 02/17/2010 - 19:03
We just moved some sites over from another host to our virtualmin setup and a site is having issues with certain characters on their site. The pages are in .php
It should like this: Saint-Pée-sur but shows like this: Saint-Pée-sur
How can I make sure those are displayed correctly? The site and servers are in english.
Thanks
Status:
Active
Comments
Hi,
This sounds like a "character encoding" issue.
Generally speaking, you should try to use the "UTF-8" encoding for international documents, as it's pretty universal, and widely used.
This can be set at the document level by adding the following into your HTML code in the "head" section:
<meta content="text/html;charset=utf-8" http-equiv="content-type" />
Or
You can set it up in Apache's configuration file like:
<VirtualHost 1.2.3.4:80>
AddDefaultCharset utf-8
...
...
*** This can also be done in the global scope as well. ***
More information on Apache's implementation can be found at:
http://httpd.apache.org/docs/2.2/mod/core.html#adddefaultcharset
-Peter
Submitted by seattleserver on Wed, 02/17/2010 - 23:42 Comment #2
Peter,
Thank you for the detailed reply. I have that set and html with those characters seem to display correctly but on their blog that uses php all their posts with special characters have issues. The blog is set to use UTF-8. If you have any other ideas that would be great.
Thanks again.
Hi,
It may be the "Default Collation" in MySQL if it's information published in the database which looks mangled.
Often times a server's "Default Collation" is set differently on the original server, and the destination server.
Please check out the article below which I believe may correct your issue:
http://drupal.org/node/198184
-Peter
Submitted by seattleserver on Thu, 02/18/2010 - 21:41 Comment #4
Peter,
I must be something with the blog because I deleted the original mysql db, created fresh with UTF-8 for collation and got the same results. I was able to edit several posts and they take the characters fine and display them but the old data is still munched. Thanks for your time. It's appreciated!