Skip to main content
Participant
March 15, 2007
Answered

utf-8 troubles

  • March 15, 2007
  • 1 reply
  • 362 views
Hi, i have a dynamic site with php/mysql. I am testing on my local machine running WAMP 1.7.0. For MYSQL, i have defined the charset to UTF-8 Unicode, collation utf8_general_ci.
In my admin section of the website I have a form to add records into the database. The page has utf-8 charset defined in the meta tag.
Now the problem - when i add text into my database (for example into a varchar field in a table) from this webpage and have a look at the data in the database through Navicat i can see that the text is broken - it does not display our Slovak characters right. Instead of the Slovak characters I get something like this ("ľščťžýá").

What am i doing wrong? Am I supposed to set the UTF-8 also in Apache somewhere or Apache has nothing to do with it? What am I missing here?

This topic has been closed for replies.
Correct answer metalllus
SOLUTION: I entered these commands into mysql console:

SET CHARACTER SET UTF8
SET character_set_client = utf8;
SET character_set_results = utf8;
SET character_set_connection = utf8;
SET NAMES = 'utf8';

Everything works just fine since then.

1 reply

metalllusAuthorCorrect answer
Participant
March 15, 2007
SOLUTION: I entered these commands into mysql console:

SET CHARACTER SET UTF8
SET character_set_client = utf8;
SET character_set_results = utf8;
SET character_set_connection = utf8;
SET NAMES = 'utf8';

Everything works just fine since then.