Skip to content

Commit

Permalink
in Ruby 1.8.7 arity of method to_xs is 0 - in 1.9.2 it takes encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
elisehuard authored and thbar committed Mar 16, 2012
1 parent a1d41f1 commit 4c4b69e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/builder/xmlbase.rb
Expand Up @@ -132,7 +132,11 @@ def _escape(text)
end end
else else
def _escape(text) def _escape(text)
text.to_xs((@encoding != 'utf-8' or $KCODE != 'UTF8')) if (text.method(:to_xs).arity == 0)
text.to_xs
else
text.to_xs((@encoding != 'utf-8' or $KCODE != 'UTF8'))
end
end end
end end


Expand Down

0 comments on commit 4c4b69e

Please sign in to comment.