diff options
author | nahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-09-02 03:06:33 +0000 |
---|---|---|
committer | nahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-09-02 03:06:33 +0000 |
commit | 97c6bc5ffd1deb626795057f01efda9ebdd9296f (patch) | |
tree | 143e1196fbdb4f4274522a8edb9a621285883fc1 /lib/csv.rb | |
parent | f7429344aa5b6ea9cfb7a82ff2e2325c71ae6715 (diff) | |
download | ruby-97c6bc5ffd1deb626795057f01efda9ebdd9296f.tar.gz |
* lib/csv.rb (CSV::IOReader#initialize): use String#[](pos, len)
instead of String#[](idx) to check utf BOM. follows String#[](idx)
behavior change of 1.9.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/csv.rb')
-rw-r--r-- | lib/csv.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/csv.rb b/lib/csv.rb index 0f6907be57..536ed8af58 100644 --- a/lib/csv.rb +++ b/lib/csv.rb @@ -599,7 +599,7 @@ class CSV @rs = rs @dev = CSV::IOBuf.new(@io) @idx = 0 - if @dev[0] == 0xef and @dev[1] == 0xbb and @dev[2] == 0xbf + if @dev[0, 3] == "\xef\xbb\xbf" @idx += 3 end @close_on_terminate = false |