Archive | April, 2009

Multi lingual support in MySQL/Rails/BASH

16 Apr

We had translations in text files that we needed imported into our mysql database.

Our database had UTF-8 character encoding which is correct.

Swedish characters were appearing like :åäà �
There are a number of issues here:
1. SSH session – if you’re using Putty make sure you’ve set the terminal to be UTF
2. check the type of your file using “file”
3. if necessary use ‘iconv’ to convert to UTF8 – iconv -f ISO-8859-1 -t UTF8 /tmp/fr2.yml
4. Ensure your browser is displaying UNICODE, View->Character Encoding in Firefox
5. If you are using Linux, make sure a UTF LANG is set eg.: export LANG=”en_AU.UTF-8″