diff --git a/lib/rexml/source.rb b/lib/rexml/source.rb index 4483aecc..999f4671 100644 --- a/lib/rexml/source.rb +++ b/lib/rexml/source.rb @@ -163,6 +163,7 @@ def initialize(arg, block_size=500, encoding=nil) end def read(term = nil) + term = encode(term) if term begin @scanner << readline(term) true @@ -174,6 +175,7 @@ def read(term = nil) def read_until(term) pattern = /#{Regexp.escape(term)}/ + term = encode(term) begin until str = @scanner.scan_until(pattern) @scanner << readline(term)