Can Your Database Handle Multiple Languages?

Ongoing WordPress Support

Do You Need Help With Your WordPress Site?

Click through to the next page and learn more about our ongoing WordPress care plans.

Date

One of the problems I have come across when building multi language website are database configurations that cannot support the new languages…

One of the problems I have come across when building multi language website are database configurations that cannot support the new languages people are planning to add.

In this post I want to give you a case study of a site that could not support Chinese and how I fixed it.

The English and Chinese Site

I was called in by a client to configure a site that would work in English and Chinese    All was going fine, the tools I use to host multiple languages were in, I was ready to start adding content and multiple menus when we found our problem …

The  Problem

Whenever we added Chinese content into the site, instead of displaying the correct characters, it displayed a line of question marks instead ??????????

The Cause

When I looked under the hood I realised we were using database collation of a type that did not support double space characters such as Chinese or Japanese and would only allow us to use Latin character sets.  Which would be fine for English, French, German etc but no use for a more complex languages.

The Solution

We needed to change the character set of your database from something that will not support double character languages like Chinese to a character set that will, always my preferred and default selection is utf8.

The majority of sites I work with use MYSQL so I’m assuming that is the case with your multi language site.  You can change your You can do this through phpmyadmin very simply by opening the database in question  going to the general settings and changing your database collation (see screen dump).

Click for full sized image
Click for full sized image

Please backup your database before you do anything like this – you have been warned.

As a matter of course I set-up all new sites with a collation of UTF8.

Can Your Database Handle Multiple Languages?

The quick test is to cut and paste this simplified Chinese sentence into your site (for those interested I think it says can  your database handle multiple languages)

你的数据库可以处理多种语言

If it shows up okay then you are good to go, if it shows ???????? you have a database issue.

Wrap Up

Often working with multiple languages throws up unexpected issues we don’t expect, if you are used to working with Latin languages this is an issue you would never expect.

If you need help with your multi language build, please contact me to get a no obligation quote.

Photo Credit: darkmatter via Compfight cc

Ongoing WordPress Support

Do You Need Help With Your WordPress Site?

Click through to the next page and learn more about our ongoing WordPress care plans.

More
articles