Jump to content

Charset problems!


esdras

Recommended Posts

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?
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.