From dc1bc25bb2cbb7e0c9fd1c9fa22bde82d595b09e Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 25 Aug 2006 13:32:39 +0000 Subject: * lib/rexml/source.rb (REXML::IOSource#initialize): encoding have to be set with the accessor. fixed: [ruby-list:42737] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@10779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 ++++++- lib/rexml/encoding.rb | 4 ++-- lib/rexml/source.rb | 6 +++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 52c9cd3be..213c7ddd8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Aug 25 22:32:04 2006 Nobuyoshi Nakada + + * lib/rexml/source.rb (REXML::IOSource#initialize): encoding have to + be set with the accessor. fixed: [ruby-list:42737] + Fri Aug 25 17:15:17 2006 Yukihiro Matsumoto * stable version 1.8.5 released. @@ -10,7 +15,7 @@ Tue Aug 22 18:47:51 2006 Yukihiro Matsumoto * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::handle_method): rdoc documents C module methods as instance methods. a patch in - [ruby-core:08536]. + [ruby-core:08536]. Sat Aug 19 14:15:02 2006 NAKAMURA Usaku diff --git a/lib/rexml/encoding.rb b/lib/rexml/encoding.rb index 644957439..8acc8a369 100644 --- a/lib/rexml/encoding.rb +++ b/lib/rexml/encoding.rb @@ -54,8 +54,8 @@ module REXML def check_encoding str # We have to recognize UTF-16, LSB UTF-16, and UTF-8 - return UTF_16 if str[0] == 254 && str[1] == 255 - return UNILE if str[0] == 255 && str[1] == 254 + return UTF_16 if /\A\xfe\xff/n =~ str + return UNILE if /\A\xff\xfe/n =~ str str =~ /^\s*' ) else @line_break = '>' end super str+@source.readline( @line_break ) - end + end def scan(pattern, cons=false) rv = super -- cgit