I don't think this is valid on Ruby 1.8, you might need to look into iconv instead.  I seem to remember Encoding is 1.9 only.