14 Jun

Fix your encoding

June 14th, 2007 — 11:26 am Chris

Everybody digs UTF-8, right? As of Rails 1.2, it’s the default encoding – which is fine and dandy if you’re into that whole unicode movement. Unfortunately, slate likes to eat characters one byte at a time. If your app is wearing 1.2.x clothing but still has the appetite of a 1.1.6 year-old, here’s how to fix it: add the following two lines to the end of the environment.rb file:

$KCODE = 'NONE'
ActionController::Base.default_charset = 'ISO-8859-1'

Yummy – Ruby code and content, one byte at a time :-)

Add comment

You are adding a new comment