I have 'inherited' an osCommerce 2.2, PHP4 and MySQL4 setup which makes trouble. The problem is the character encoding. While the tables are defined to contain
UTF8 they actually contain
latin1. To mix something completely new into this, it seems like the old coder manually changed this by setting
SET CHARACTER SET 'utf8' when the connection to the database is made.
It now looks like this:
UTF8but actually contains
- PHP: MySQL-Connection gets manually set to
- HTML: is delivered as
This setup worked until a week ago when the provider changed something (they actually denied touching the database or any other stuff at all, but they had server problems).
The problematic part is that german special characters
öäüß are displayed correctly, but the moment you want to insert them into the database the whole osCOmmerce sessions breaks and only the text until that character is inserted.
- Text to insert:
Das _ä_ ist ein Umlaut
- Text which gets saved:
The moment I change the manual intrusion by setting the character set to
latin1 when the connection is established, every insert is fine, but the database is only delivering
? instead of the special characters.
I have no idea how to resolve this, if I change the database columns to
latin1 I lose all special characters, if I change the encoding on the connection either the displaying or inserting fails. I'm completely out of ideas.