Should a Project Be Converted to UTF-8? – PHP Character Encoding Guide

character encodinginternationalizationPHP

I am working on a highly customized shop software, based on a open-source one, written in PHP and usual web techniques (CSS, HTML, JS).

I did a lot of customization in the past months/years and developed specific, individual features which are necessary to be successful at our branch.

The shop and the project files are encoded in ISO-8859-1 (company is located in Germany).

Now we want to spread out and use the shop system in different countries (e.g. Sweden, Poland, Great Britain) and customize it to the domestic needs.

But I am afraid that I could encounter some encoding problems afterwards, so my question is:

Is it wise to change the encoding of the whole project and the environment to UTF-8 before I prepare the shop for "multi-shop" usage or should I leave the source at it is and handle (possible) encoding problems for each country as they approach afterwards?

Best Answer

You will encounter encoding problems. You can handle Swedish and English with ISO-8859-1, but not Polish. You could use ISO-8859-2 for Polish, but then you would need to use other encodings when moving to languages that are not covered with ISO-8859-1 or ISO-8859-2.

So it is best to internationalize the software, using UTF-8, which covers all languages, and using UTF-8 throughout.