Skip to content

Instantly share code, notes, and snippets.

@drobune
Last active December 20, 2015 15:19
Show Gist options
  • Save drobune/6153012 to your computer and use it in GitHub Desktop.
Save drobune/6153012 to your computer and use it in GitHub Desktop.
how to parse xml and guess encording in ruby
#perse xml
require 'rexml/document'
doc = REXML::Document.new(response[:body])
doc.elements['response/result'].text
#guess encording
require 'nkf'
NKF.guess(response[:body])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment