Archive for the ‘Localisation’ Category

PHP, MySQL and Unicode: correctly display all characters?

Tuesday, January 31st, 2012

This is a post born from spending hours trying to squash bugs and zap gremlins.

In an attempt to streamline content re-versioning in different languages, I had created a work flow that went like this:

  1. Create Google spreadsheet for easy collaborative editing
  2. Pull down a Microsoft Excel version of the Google spreadsheet (alas, not CSV as the Google-generated CSV wasn’t playing ball with MySQL)
  3. Import this into MySQL
  4. Generate static HTML with translations inserted where appropriate for each language

The process was fine, but somewhere within all these steps something was going awry. Latin characters with accents weren’t showing up properly and apostrophes were rendering in all different ways — �, `â, ? — anything except what I needed. Furthermore, Cyrillic, Chinese and Arabic weren’t even displaying at all.

I tried many things in PHP — preg_replace, utf8_encode, mb_convert_encoding, and even iconv — but all to no avail.

Finally, I spotted a snippet on the MySQL site from 2006, written by Lorenz Pressler:

after mysql_connect() , and mysql_select_db() add this lines:
mysql_query(“SET NAMES utf8″);

…and that was all I needed. In fact I didn’t even need to convert anything into UTF-8 in PHP. Once MySQL was outputting UTF-8 correctly, everything was fine. The database was encoded in UTF-8, so I assumed too much in thinking that meant it would automatically output it in that way.

So, if ever you have problems with MySQL and UTF characters not displaying, try SET NAMES and hopefully that’l fix the issue.

Flags and languages: Redux (Part II)

Sunday, November 6th, 2011

Back in June I wrote about the eternal issue of using flags to represent languages and why this is a fundamentally flawed idea.

Entitled ‘Flags and languages: Redux (Part I)’, I’d obviously planned writing a Part II that would deal with the entire issue in some detail.

Well, I tried, and it’s quite amazing how complex the issues involved are — which for me is just more proof as to why using flags as languages is a really bad idea.

I quickly realised there was far more than a simple blog post involved. So Part II is actually a whole new blog: Flags are not languages.

Flags are not languages

Hopefully this blog will help in someway to curtail these bad design practices, as well as exploring and promoting best practice for displaying and presenting different language content.

So next time someone suggests plonking a Spanish flag on the link for Spanish (or German, French, Arabic etc.) — hopefully you can just send them this link and they can understand why using flags for languages is wrong.

SXSW 2012: The submission is in

Wednesday, August 17th, 2011

I enjoyed my first SXSW so much this year that I decided to take the plunge and submit a panel idea.


I’ve entitled the proposal ‘Global UX: beyond language, location and culture‘. I’m hoping to impart some of the UX and design knowledge I’ve learnt over the years from working at a multi-language media outlet (BBC World Service) along with a few of my other design passions: from general usability through to my obsession with seeing the end of flags being used to represent languages.

So, check it out, and if you like the sound of it, give it a vote!

Flags and languages: Redux (Part I)

Tuesday, June 21st, 2011

If you search for ‘using flags to represent languages’, you’ll get a swathe of wisdom as to why this is a really bad idea. This really bothers me whenever I see it; which unfortunately is really quite often. I blogged about a language selection screen in the Steam client last year which again fell into the trap of presenting users with a selection of flag icons in order to choose their language.

I went to the Tate site today and a little UN-style gathering of flags caught my attention.

Tate homepage

What really bothers me about what the Tate have done here is that they’ve obviously put some thought into this design decision, but the logic behind the decision is broken.

Airlines: Please kill your interstitial pages!

Saturday, June 18th, 2011

Comparison sites such as Kayak and Skyscanner are not only great for finding great deals on flights and hotels, but also cutting out much of the below-par user experience that seems endemic with many airline sites — in particular the obsession the airline industry seems to have with interstitial pages.

It’s depressing how many major airlines present you with screens like this on their landing pages:

British Airways


TED Translations: free to the world

Wednesday, May 18th, 2011

TED Talks are wonderful. Yesterday I watched this fascinating video by Eli Pariser, entitled Beware online “filter bubbles”:

While watching the video (on the TED website) I noticed the subtitle options. TED has a fantastic translation scheme where users can transcribe translations for videos — a staggering 18,265 translations so far. But user experience-wise, this scheme has some critical issues.


Why is Flash so lousy at localisation?

Saturday, May 7th, 2011

Originally I intended this post to be a series of examples demonstrating some of the hassles involved when dealing with multi-lingual content in Flash. But it occurred to me that the issue isn’t so much that Flash is difficult for this purpose, it’s more that it’s lousy. It’s way behind the curve considering where the rest of the web is today in this regard, and incredibly the situation was far worse not much more than twelve months ago (before Adobe released Flash CS5 and the Text Layout Framework).

The rationale for this post came after attending a talk at SXSW 2011 — ‘Flash is Dead, Long Live Flash!‘. The presenters, Elliot Chong and Toby Miller, gave a great overview of strengths and weaknesses of both Flash and HTML 5. However, one point of debate they missed was localisation. Not that I expected to hear it, but I feel strongly about such things considering this is a big part of my day job. During the Q&A session, I brought up the point of localisation — but explaining technical trivialities on the spur of the moment in front of a large crowd of peers can be tricky: hence this post.


Flags and languages just don’t work

Sunday, August 15th, 2010

I always find it quite insulting when the United States flag gets used as an icon for ‘English’. Technically it shouldn’t even be the British flag, but really the English flag. But you don’t often see that do you?

Steam screenshot

And considering there are more Portuguese speakers in Brazil than Portugal, why not show the Brazil flag for Portuguese (if you’re being consistent with the use of the US flag).

Or… just don’t use flags to illustrate language. Ever.