Created
October 20, 2009 15:17
-
-
Save mperham/214321 to your computer and use it in GitHub Desktop.
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
>> x = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') do |xml| | |
?> xml.feed do |ctx| | |
?> xml.title "This isn't a test & certainly does not test \"quotes\"" | |
>> end | |
>> end | |
=> #<Nokogiri::XML::Builder:0x1013c5a30 @arity=1, @context=nil, @parent=<?xml version="1.0" encoding="UTF-8"?> | |
>> x.to_xml | |
=> "<?xml version="1.0" encoding="UTF-8"?>\n<feed>\n <title>This isn't a test & certainly does not test "quotes"</title>\n</feed>\n" | |
The amp is encoded but shouldn't Nokogiri also encode ' and " characters, per http://xml.silmaril.ie/authors/specials/? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment