Use conditional to encode with iconv for Ruby 1.8