I’m currently trying to convert some data stored in a MySQL-db.
It’s a PunBB forum, tables are UTF-8, and should be converted to PHPBB2 (Latin1 tables).
My problem is - equally which charsets and functions I use for the conversion (within my PHP script) - special chars (e.g. German umlauts) won’t show (respectively garbled).
So, here’s my current procedure:
-> SET NAMES utf8
-> Select data from UTF8 table
-> SET NAMES latin1
-> Insert data into latin1 table
I’ve also tried to convert the data before inserting it using:
-> utf8_decode(utf8_decode(<string>)) (yes, doubled, just for testing)
-> mb_convert_encoding(<string>, iso-8859-1)
-> mb_convert_encoding(<string>, iso-8859-1, utf-8)
I’va also tested with:
-> No SET NAMES at all (should be UTF-8 as this is my default)
-> SET NAMES utf8 without changig before inserting
-> SET NAMES latin1 before selecting
Any ideas what’s wrong with my approach?
I’m running out of ideas and need to get that fixed.
If you need further input (e.g. table structures) let me know but please be patient, gotta get some sleep as it’s already 5 am.
Thanks in advance!