How to enter a multibyte Unicode string in PHP
This has just taken me a surprisingly long time to work out …
I needed to output a file with the following as a marker in various places.
Technical information on this site may be out of date : no updates since 2015
This has just taken me a surprisingly long time to work out …
I needed to output a file with the following as a marker in various places.
It’s easy to save an Excel file as CSV and read it in PHP with the fgetcsv function but this may not work so well if the file contains non-English characters.
Excel uses a non-standard character encoding for csv files.
You can save an Excel file as ‘unicode’ text however there are several unicode systems - Windows uses UTF-16, and PHP uses UTF-8.
To open the ‘unicode text’ file in PHP you have to convert it, in addition you may want to be able to open UTF-8 files that may be created by other systems.
I’ve worked on a few internationalised sites in the past and it always raises challenges, Drupal makes some things easy - this post provides some simple tips for planning your translation process.
This advice is aimed at sizeable sites with formal release processes.