Strange encoding problem (ISO-8859-2 and UTF-8)
Posted by:
Pajak Leon
Date: August 23, 2007 03:53PM
Hello.
I have strange problem with encoding in my database, which has been already on three different mysql servers with various encodings.
At the beginning database was ISO-8859-2 (latin2). After migrations to new server
The columns are in UTF-8 (columns are: charset utf8, collate utf_general_ci).
But to display correctly national chars on site (utf-8 in php) i need to execute following commands in php after creating connection to database:
mysql_query("SET CHARACTER SET 'latin2'", $db);
mysql_query("SET NAMES 'latin2'", $db);
When i execute those commands, national string are correctly displayed on site. I've lived with this for one year, but now i need to connect to database in Java and there those commands don't work. I need to repair it.
Questions:
1. What is the encoding of text in my database UTF-8 or latin2(ISO-8859-2) ?
2. How to repair my database to have normal UTF-8 data without any tricls with setting CHARACETER SET and NAMES to latin2?
Subject
Views
Written By
Posted
Strange encoding problem (ISO-8859-2 and UTF-8)
19589
August 23, 2007 03:53PM
6159
October 07, 2007 01:04PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.