diff options
Diffstat (limited to 'lib/rexml/output.rb')
-rw-r--r-- | lib/rexml/output.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/rexml/output.rb b/lib/rexml/output.rb index 50333ba177..208bb0ade1 100644 --- a/lib/rexml/output.rb +++ b/lib/rexml/output.rb @@ -11,6 +11,11 @@ module REXML self.encoding = encd @to_utf = encd != 'UTF-8' + + if encoding == "UTF-16" + @output << "\ufeff".encode("UTF-16BE") + self.encoding = "UTF-16BE" + end end def <<( content ) |