Jump to content


Charset problems!

  • Please log in to reply
1 reply to this topic

#1 esdras

  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 15 February 2006 - 10:02 PM

Hi people,

I'm in trouble with charset configuration.
PHP Default Charset is set to ISO-8859-1. (it's the server configuration, I can't change)
MySQL database and its tables are set to utf8_general_ci.
My HTML/PHP files are UTF8, and so are their meta tags.
I was using all in UTF8 without problem, because my local server have no problem with it. The troubles described here are at the remote server, where my site is hosted.

But when I insert data from a form to MySQL, it's miscoded. Since I'm from Brazil, I'm having problems with some special characters, like "á", "ç" etc.

If I convert them using htmlentities(), they will use more characters than they really have. For example, "á" will become "´". If the field has support for 20 characters, "ábc" will become "´bc" and use 9 characters.

A strange thing: although the site is all in UTF8, browsers only load the pages as ISO-8859-1.

How can I fix this?

#2 fenway

  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 16 February 2006 - 07:48 PM

Sounds like your server isn't serving the pages as UTF-8, which may actually be the solution to the problem itself.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users