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″

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: