If ruby 1.8.7 use iconv instead of encode method of the > 1.9.0