Last active
December 20, 2015 15:19
-
-
Save drobune/6153012 to your computer and use it in GitHub Desktop.
how to parse xml and guess encording in ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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