Skip to content

Instantly share code, notes, and snippets.

@tcaddy
Created January 27, 2012 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tcaddy/1688976 to your computer and use it in GitHub Desktop.
Save tcaddy/1688976 to your computer and use it in GitHub Desktop.
Convert Datatel export files to UTF-8 using Ruby
=begin
I am using Ruby to parse exported data generated from Datatel. I ran into a strange problem with conflicting character sets.
Datatel's internal character set is: ISO_8859-1
Datatel will set the metadata in the export text file to be: US-ASCII
And I want Ruby to use this charset: UTF-8
=end
Iconv.new("UTF-8","ISO_8859-1").iconv(File.open('datatel_export_file.txt').read)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment