[前][次][番号順一覧][スレッド一覧]

ruby-changes:62282

From: Sutou <ko1@a...>
Date: Mon, 20 Jul 2020 03:35:33 +0900 (JST)
Subject: [ruby-changes:62282] cf7e472ab4 (master): [ruby/csv] test scanner: specify encoding explicitly

https://git.ruby-lang.org/ruby.git/commit/?id=cf7e472ab4

From cf7e472ab412044d97d6ec5263daed456c4f2724 Mon Sep 17 00:00:00 2001
From: Sutou Kouhei <kou@c...>
Date: Sun, 17 May 2020 11:58:07 +0900
Subject: [ruby/csv] test scanner: specify encoding explicitly

https://github.com/ruby/csv/commit/6e83a1de9c

diff --git a/lib/csv/parser.rb b/lib/csv/parser.rb
index 924ca46..68fe238 100644
--- a/lib/csv/parser.rb
+++ b/lib/csv/parser.rb
@@ -708,7 +708,7 @@ class CSV https://github.com/ruby/ruby/blob/trunk/lib/csv/parser.rb#L708
     if SCANNER_TEST
       class UnoptimizedStringIO
         def initialize(string)
-          @io = StringIO.new(string)
+          @io = StringIO.new(string, "rb:#{string.encoding}")
         end
 
         def gets(*args)
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]