i have an old site whose database is in latin-1 encoding. i have created a drupal site duplicate of old site By default drupal database is in utf-8 encoding now how do i port the database from latin-1 to utf-8 . i tried myself and i get unwanted charachters . how should i do it.
+1
A:
Here is the possible solution:
http://www.oreillynet.com/onlamp/blog/2006/01/turning_mysql_data_in_latin1_t.html
Hope that helps :)
Sarfraz
2009-12-02 12:02:50
A:
An easy manual way: export you database’s content e.g. with phpMyAdmin. Then create a UTF-8 coded empty text file, copy and paste the export file’s content, and then edit the table definitions to use UTF-8, if neccessery.
Joó Ádám
2009-12-02 12:03:50
What the hell is an "UTF-8 coded emtpy text file"? If it's empty, what is its encoding supposed to be?
sleske
2009-12-02 12:27:29
Have you ever heard of something like MIME types?…
Joó Ádám
2009-12-03 12:09:58
A:
You can do it using a script done in another language, in Groovy for example you would do:
def utf8 = java.nio.charset.Charset.forName("UTF-8")
def latin1 = java.nio.charset.Charset.forName("ISO-8859-1") // this is latin1
def newString = new String(fetchStringFromDB().getBytes(latin1), utf8)
updateStringInDB(newString)
Jack
2009-12-02 12:05:22
sleske
2009-12-02 12:29:11