diff --git a/ChangeLog b/ChangeLog index 595c359615..baef4bebaa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sun Oct 28 19:54:43 2012 Kouhei Sutou + + * lib/rexml/source.rb (REXML::IOSource#initialize): Use + encode("UTF-16XX") instead of UTF-16XX encoded byte string by + hand. + Sun Oct 28 19:12:11 2012 Tadayoshi Funaba * ext/date/date_parse.c (iso8601_{ext,bas}_time): should not match diff --git a/lib/rexml/source.rb b/lib/rexml/source.rb index 112393cfd4..46c2fc79cd 100644 --- a/lib/rexml/source.rb +++ b/lib/rexml/source.rb @@ -149,9 +149,9 @@ module REXML if encoding self.encoding = encoding elsif str[0,2] == "\xfe\xff" - @line_break = "\000>" + @line_break = ">".encode("UTF-16BE") elsif str[0,2] == "\xff\xfe" - @line_break = ">\000" + @line_break = ">".encode("UTF-16LE") elsif str[0,2] == "\xef\xbb" str += @source.read(1) str = '' if (str[2,1] == "\xBF")