Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a site that is in English but has a lot of German and Spanish names in it. Originally I was using UTF8, but that gave me problems with some of the German special characters. So I switched to: ISO 8859, but then the german characters were fixed but it broke all the Spanish ones. I changed to ISO 8859 in the wp-config file, but it seems like phpmyadmin doesn't even give me the option to choose ISO 8859.

This might be tolerable but after fixing all the accents using special characters, if you later change anything on the page all the accents break again and you have to insert all the special characters again!

any suggestions?

Thanks in advance!!!

share|improve this question
add comment

3 Answers

Whew - Ok I figured it out. First off thanks Pippin and Peter.

The problem is that it apparently confuses some wp plugins if a specific collate hasn't been declared in wp-config:

/** Database Charset to use in creating database tables. */ define('DB_CHARSET', 'utf8');

/** The Database Collate type. Don't change this if in doubt. */ define('DB_COLLATE', 'utf8_general_ci');

both utf8_general_ci & utf8_unicode_ci

work correctly. Umlauts and acutes all now show correctly!

share|improve this answer
add comment

Take a look at my answer for Word press replacing unicode characters with "?"s. Amongst others you could take look at the mentioned Codex article Converting Database Character Sets.

You should really stick to UTF8 unless there's a very good reason not to do so. If code and DB are all in sync using UTF-8, you shouldn't have any problems with German nor Spanish.

Let us know if this helps.

share|improve this answer
    
Hey Peter, thanks for the response. I'm using UTF8 across the board now - wpsettings, wpconfig, and db tables. I checked out both posts - I'm really at a lost - this only affects text that has been entered through the wp mce. Argh –  user3498 Mar 8 '11 at 0:46
    
Hi Yetti, apart from having all the settings correct, you also need to be sure that the data in your db is properly encoded. Have a look at this article: oreillynet.com/onlamp/blog/2006/01/…. Data can look right in one or the other interface, but that doesnt necessarily mean that it's correctly encoded under the hood. This can especially happen when changing db encoding without using the proper conversion methods. You could also try and re-enter some of the corrupted data to see if it shows up after doing so. –  Peter Mar 8 '11 at 13:09
    
...Pippin's suggestion is also worth checking out; does the problem still exist after deactivating all plugins? –  Peter Mar 8 '11 at 13:14
add comment

You have to make sure that your code editor is saving the file in UTF-8. most likely it's saving in something like ASCII. Once you've changed the char-set of your editor, copy and paste the code from one file to another and resave.

share|improve this answer
    
Hey Pippin! How can you tell what the interface of certain plugins output? I've checked all db tables and it seems to be UTF for all of them. –  user3498 Mar 8 '11 at 0:48
    
Are the badly-encoded characters being outputted by a plugin, or from a theme template? –  Pippin Mar 8 '11 at 3:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.