lib/ms/ident/pepxml.rb in ms-ident-0.0.2 vs lib/ms/ident/pepxml.rb in ms-ident-0.0.3

- old
+ new

@@ -16,10 +16,11 @@ end class Ms::Ident::Pepxml XML_STYLESHEET_LOCATION = '/tools/bin/TPP/tpp/schema/pepXML_std.xsl' DEFAULT_PEPXML_VERSION = MsmsPipelineAnalysis::PEPXML_VERSION + XML_ENCODING = 'UTF-8' attr_accessor :msms_pipeline_analysis def pepxml_version msms_pipeline_analysis.pepxml_version @@ -48,10 +49,10 @@ end # if no outfile is given, an xml string is returned. summary_xml should # have already been set and is not influenced by the outfile given here. def to_xml(outfile=nil) - builder = Nokogiri::XML::Builder.new + builder = Nokogiri::XML::Builder.new(:encoding => XML_ENCODING) msms_pipeline_analysis.to_xml(builder) add_stylesheet(builder.doc, Ms::Ident::Pepxml::XML_STYLESHEET_LOCATION) string = builder.doc.to_xml outfile ? File.open(outfile,'w') {|out| out.print(string) } : string end