Skip to content

Commit

Permalink
Jruby requires explicit declaration of character encoding on the to_x…
Browse files Browse the repository at this point in the history
…ml method, otherwise it tries to turn everything into USASCII
  • Loading branch information
Bess Sadler committed Jul 29, 2014
1 parent 8da1ecb commit 33c9aa2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/harvestdor/purl_xml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def self.dc object, purl_url = Harvestdor::PURL_DEFAULT
pub_xml_ng_doc = pub_xml(object, purl_url)
begin
# preserve namespaces, etc for the node
ng_doc = Nokogiri::XML(pub_xml_ng_doc.root.xpath('/publicObject/dc:dc', {'dc' => Harvestdor::OAI_DC_NAMESPACE}).to_xml)
ng_doc = Nokogiri::XML(pub_xml_ng_doc.root.xpath('/publicObject/dc:dc', {'dc' => Harvestdor::OAI_DC_NAMESPACE}).to_xml(:encoding => 'utf-8'))
raise Harvestdor::Errors::MissingDC.new(object.inspect) if !ng_doc || ng_doc.children.empty?
ng_doc
rescue
Expand Down

0 comments on commit 33c9aa2

Please sign in to comment.