ISO-8859-1 in UTF-8 columns?
Posted by: Levi Tedder
Date: October 12, 2010 03:52AM

Hi

I recently installed a new Mysql server, and thought I would move from ISO-8859-1 (latin1?) to UTF-8. Somewhere I made a mistake and after fiddling some with this, charsets and encoding is just confusing to me :)
I read somewhere that mysqldump actually dumped the database in UTF-8, so I didn't need to convert the dump in any way. So I dumped the schema and data in two different backup files, and changed the latin1 in the schema backup to utf-8, and imported the files. Phpmyadmin and ms access showed correct characters, and I thought everything was ok. Until today, when I discovered I've overlooked some web-pages with ISO-8859-1 and not UTF-8 - web pages that creates and updates data. When I changed to UTF-8 the special norwegian character (for example) "broke". Some characters fetched from the db just looks weird.

I created a php-script to detect encoding in strings fetched from the db. It shows ISO-8859-1 on data retrieved that was created before I made the switch on the web pages, and UTF-8 on data created afterwards. So as I understand I have some data in my utf-8 tables encoded in ISO-8859 (latin1)? Is it possible to (easily) fix the data, to get everything in (true) UTF8? Update query of sorts? I could create a php-script that fetches everything, utf8-encodes it, and put it back in the database...

Thanks and sorry if I sound very confused about this :)
Levi

Options: ReplyQuote


Subject
Views
Written By
Posted
ISO-8859-1 in UTF-8 columns?
9306
October 12, 2010 03:52AM
2947
October 13, 2010 06:08PM


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.