[forwarded from ruby-dev to ruby-core, with translation(t)/comments(c)]


At 13:42 08/10/24, TAKANO Mitsuhiro wrote:
>高野です。
>

(t) This is Takano. This is a patch regarding

>----
>1) Failure:
>test_inspect_is_ascii_8bit_encoded(TestCSVRow)
>[/home/takano/ruby/test/csv/test_
>row.rb:300]:
><"ASCII-8BIT"> expected but was
><"US-ASCII">.
>----
>
>についてのパッチです。
>
># ほんとにこんなんでいいのかな・・・
># 文字コード周りに詳しい方教えてくださいっ。m(_ _)m

(t) I'm not sure this is the right thing to do,...
(t) Somebody who knows about character encoding, please help.

(c) The patch below doesn't look like something we want
    programmers to have to do. Either we need some change
    in the test, or we need some some fix in the logic.
    "US-ASCII" is in all respecs a subset of "ASCII-8BIT",
    so things will work just fine.

    Regards,    Martin.

>
>Index: lib/csv.rb
>===================================================================
>--- lib/csv.rb  (revision 19903)
>+++ lib/csv.rb  (working copy)
>@@ -495,7 +495,7 @@
>                ":" << field.inspect
>       end
>       str << ">"
>-      str.map { |s| s.encode("ASCII-8BIT") }.join
>+      str.map { |s| s.encode("ASCII-8BIT") }.join.encode("ASCII-8BIT")
>     end
>   end


#-#-#  Martin J. Du"rst, Assoc. Professor, Aoyama Gakuin University
#-#-#  http://www.sw.it.aoyama.ac.jp       mailto:duerst / it.aoyama.ac.jp