Page 1 of 1

UTF8 characters problem

Posted: Mon Aug 06, 2007 11:13 am
by yacahuma
I hope someone can help me here . It is driving me crazy.

For the first time I am writing an application with utf-8 in the application and in the database.

for all my outputs I am using

htmlentities($data,ENT_QUOTES,'UTF-8')

also I am using in the header

meta http-equiv="content-type" content="text/html;charset=utf-8"

The database is all utf8 and utf8-general_ci (every character field with utf8)

Inside the application all the Spanish characters look fine. But if I see those characters using phpmyadmin or Navicat they look weird.

Before I used latin1 and spanish characters will look fine of the web and on the database and i did not have to do the htmlentities (altought I should have use it anayway).

What am I missing?? What is the secret formula to get this working??

Posted: Mon Aug 06, 2007 5:50 pm
by tecktalkcm0391
I don't get what your asking. If everything is working in a browser, then everything is fine. If they are messing up in the database don't worry about it as long as it comes back correct.

Edit: But if you really want it fixed read this: http://www.phpwact.org/php/i18n/utf-8/mysql

Posted: Mon Aug 06, 2007 6:10 pm
by VladSun
I would also suggest to check your Apache (if you use this www server) directives - especially "AddDefaultCharset" - it must be turned "Off" if you want to have control on charsets being used.

mysql clients need to be told character set

Posted: Tue Aug 07, 2007 12:52 pm
by yacahuma
There is a setup in Navicat that allows you to force the enconding you are looking. I change it to be utf 8 and now when I work on navicat i see the characters as expected.


I dont know how to do the same thing on phpmyadmin??

The main problem was that I was not sure whos fault was it. I thought the mysql clients will automatically detect the encoding and show the correct character set. I was wrong.