Skip to content

Instantly share code, notes, and snippets.

@vladimir-e
Last active December 15, 2015 01:19
Show Gist options
  • Save vladimir-e/5178828 to your computer and use it in GitHub Desktop.
Save vladimir-e/5178828 to your computer and use it in GitHub Desktop.
The only way I managed to convert german text from latin1-swedish-ci to be able to use in ruby #ruby #encoding #utf
puts oldproduct.title
# => Gestänge Stahl lang für Tarps (240cm)
i = Iconv.new('LATIN1','UTF-8')
new_title = i.iconv(oldproduct.title).force_encoding("UTF-8")
puts new_title
# => Gestänge Stahl lang für Tarps (240cm)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment