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 | b459d4b1c8034af64fa3270add45a5b9d6bd39cb (patch) | |
| tree | 143e1196fbdb4f4274522a8edb9a621285883fc1 | |
| parent | 940b950cd222eeb0f952284928584b82296d8140 (diff) | |
| download | ruby-b459d4b1c8034af64fa3270add45a5b9d6bd39cb.tar.gz ruby-b459d4b1c8034af64fa3270add45a5b9d6bd39cb.tar.xz ruby-b459d4b1c8034af64fa3270add45a5b9d6bd39cb.zip | |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@10829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 6 | ||||
| -rw-r--r-- | lib/csv.rb | 2 |
2 files changed, 7 insertions, 1 deletions
@@ -1,3 +1,9 @@ +Sat Sep 2 12:00:32 2006 NAKAMURA, Hiroshi <nahi@ruby-lang.org> + + * 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. + Fri Sep 1 22:07:04 2006 Yukihiro Matsumoto <matz@ruby-lang.org> * ruby.h (RSTRING_EMBED_LEN_MASK): uses 5 bits to support 64bit diff --git a/lib/csv.rb b/lib/csv.rb index 0f6907be5..536ed8af5 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 |
