PENDINGS.rb (Was: Re: [Ruby 1.9 - Bug #354] (Assigned) Test failure test/ruby/test_transcode.rb)

e$B1sF#$G$9!#e(B

2008/07/24 0:44 Yui NARUSE [email protected]:

e$B0J>e$N$h$&$JM}M3$N$?$a!"[email protected]$Oe(B transcode e$B$N;EMM$N3NDjBT$A$H$J$k$?$a!"e(B
[email protected]$5$l$J$$4{CN$N%P%0!W$H$$$&$N$,8=:_$N%9%F!<%?%9$K$J$j$^$9!#e(B

e$B$J$N$G!"$=$N$h$&$J<q;]$NJL%U%!%$%k$K%F%9%H$r0\F0$7$?$$e(B

e$B;[email protected]$G$9!#D>$kM=Dj$N$J$$%F%9%H$re(B make test-all
e$B$KJ|CV$7$F$*$/$N$O!"e(B

e$B%F%9%H7k2L$N;kG’@-$,0-$/$J$j!"%j%0%l%C%7%g%s%F%9%H$,$7$K$/$/$J$ke(B

e$B!V%F%9%H$OB?>/<:GT$7$F$F$b$$$$!W$H$$$&%@%a$JG’<1$,9-$^$C$F$7$^$&e(B

  • e$B;v>p$rCN$i$J$$?M$K$O%S%k%I$N<:GT$J$I$H6hJL$,$D$+$J$$e(B

e$B$Ne(B 3 [email protected]$+$i!"$h$/$J$$$H;W$$$^$9!#e(B

e$B$=$N$h$&$J>[email protected]$H;W$o$l$k%F%9%H$O!"0J2<$Ne(B 3 [email protected]$G$9!#e(B

  • test_getc_stateful_conversion(TestIO_M17N)

  • test_terminator_stateful_conversion(TestIO_M17N)

    • stateful encoding e$B$OEvJ,%5%]!<%H$5$l$J$$e(B
  • test_iso_2022_jp(TestTranscode)

    • EUC e$B$NJd=u4A;z$OEvJ,%5%]!<%H$5$l$J$$e(B

e$B$3$l$i$Oe(B test/ruby/PENDINGS.rb e$B$K0$7!"e(Bmake test-all
(e$B$de(B make check)
e$B$G$O<B9T$7$J$$$h$&$K$7$?$$$H;W$$$^$9!#e(B
([email protected]$7!"2?$G$b$+$s$G$be(B PENDINGS.rb
e$B$KF~$l$?$i%@%a$G$9!#=EMW!#e(B)

e$B$I$s$J$b$s$G$7$g$&$+!#e(B

e$B0J2<$N%Q%C%A$G$O!"e(Bmake test-all-including-pendings e$B$Ge(B
PENDINGS.rb e$B$be(B
e$B4^$a$?%F%9%H$rAv$i$;$k$h$&$K$7$F$_$^$7$?!#e(B

Index: common.mk

— common.mk (revision 18196)
+++ common.mk (working copy)
@@ -368,6 +368,9 @@
test-all:
$(RUNRUBY) “$(srcdir)/test/runner.rb” --basedir="$(TESTSDIR)"
–runner=$(TESTUI) $(TESTS)

+test-all-including-pendings:

  • $(RUNRUBY) “$(srcdir)/test/runner.rb” --basedir="$(TESTSDIR)"
    –runner=$(TESTUI) --pattern=PENDINGS.rb $(TESTS)

extconf: $(PREP)
$(MINIRUBY) -run -e mkdir – -p “$(EXTCONFDIR)”
$(RUNRUBY) -C “$(EXTCONFDIR)” $(EXTCONF) $(EXTCONFARGS)
Index: test/ruby/test_transcode.rb

— test/ruby/test_transcode.rb (revision 18196)
+++ test/ruby/test_transcode.rb (working copy)
@@ -259,13 +259,11 @@
assert_raise(RuntimeError) { “\x1b$(A”.encode(“utf-8”,
“iso-2022-jp”) }
assert_equal("\uff71\uff72\uff73\uff74\uff75",

“\x1b(I12345\x1b(B”.force_encoding(“iso-2022-jp”).encode(“utf-8”)) #
JIS X 0201 e$B%!%#%%%’%)e(B

  • assert_equal("\u9299", “\x1b$(Dd!\x1b(B”.encode(“utf-8”,
    “iso-2022-jp”)) # JIS X 0212 e$B6he(B68 [email protected](B01 ?
    assert_raise(RuntimeError) { “\x1b$C”.encode(“utf-8”,
    “iso-2022-jp”) }
    assert_raise(RuntimeError) { “\x1e”.encode(“utf-8”, “iso-2022-jp”)
    }
    assert_raise(RuntimeError) { “\x80”.encode(“utf-8”, “iso-2022-jp”)
    }

    assert_equal("\x1b(I12345\x1b(B".force_encoding(“iso-2022-jp”),
    “\uff71\uff72\uff73\uff74\uff75”.encode(“iso-2022-jp”))

  • assert_equal("\x1b$(Dd!\x1b(B".force_encoding(“iso-2022-jp”),
    “\u9299”.encode(“iso-2022-jp”))
    end
    end
    Index: test/ruby/test_io_m17n.rb
    ===================================================================
    — test/ruby/test_io_m17n.rb (revision 18196)
    +++ test/ruby/test_io_m17n.rb (working copy)
    @@ -157,18 +157,6 @@
    }
    end

  • def test_terminator_stateful_conversion

  • with_tmpdir {

  •  src = "before \e$B\x23\x30\x23\x31\e(B
    

after".force_encoding(“iso-2022-jp”)

  •  generate_file('tmp', src)
    
  •  s = open("tmp", "r:iso-2022-jp:euc-jp") {|f|
    
  •    f.gets("0".force_encoding("euc-jp"))
    
  •  }
    
  •  assert_equal(Encoding.find("euc-jp"), s.encoding)
    
  •  assert_str_equal(src.encode("euc-jp"), s)
    
  • }

  • end

  • def test_nonascii_terminator
    with_tmpdir {
    generate_file(‘tmp’, “before \xA2\xA2 after”)
    @@ -214,17 +202,6 @@
    }
    end

  • def test_getc_stateful_conversion

  • with_tmpdir {

  •  src = "\e$B\x23\x30\x23\x31\e(B".force_encoding("iso-2022-jp")
    
  •  generate_file('tmp', src)
    
  •  open("tmp", "r:iso-2022-jp:euc-jp") {|f|
    
  •    assert_equal("\xa3\xb0".force_encoding("euc-jp"), f.getc)
    
  •    assert_equal("\xa3\xb1".force_encoding("euc-jp"), f.getc)
    
  •  }
    
  • }

  • end

  • def test_open_ascii
    with_tmpdir {
    src = “abc\n”
    Index: test/ruby/PENDINGS.rb
    ===================================================================
    — test/ruby/PENDINGS.rb (revision 0)
    +++ test/ruby/PENDINGS.rb (revision 0)
    @@ -0,0 +1,62 @@
    +# -- encoding: ASCII-8BIT -- # make sure this runs in binary mode
    +# some of the comments are in UTF-8

+require ‘test/unit’
+require ‘tmpdir’
+require ‘timeout’
+
+class TestIO_M17N_PENDING < Test::Unit::TestCase

  • def with_tmpdir
  • Dir.mktmpdir {|dir|
  •  Dir.chdir(dir) {
    
  •    yield dir
    
  •  }
    
  • }
  • end
  • def generate_file(path, content)
  • open(path, “wb”) {|f| f.write content }
  • end
  • def encdump(str)
  • “#{str.dump}.force_encoding(#{str.encoding.name.dump})”
  • end
  • def assert_str_equal(expected, actual, message=nil)
  • full_message = build_message(message, <<EOT)
    +#{encdump expected} expected but not equal to
    +#{encdump actual}.
    +EOT
  • assert_block(full_message) { expected == actual }
  • end
  • def test_getc_stateful_conversion
  • with_tmpdir {
  •  src = "\e$B\x23\x30\x23\x31\e(B".force_encoding("iso-2022-jp")
    
  •  generate_file('tmp', src)
    
  •  open("tmp", "r:iso-2022-jp:euc-jp") {|f|
    
  •    assert_equal("\xa3\xb0".force_encoding("euc-jp"), f.getc)
    
  •    assert_equal("\xa3\xb1".force_encoding("euc-jp"), f.getc)
    
  •  }
    
  • }
  • end
  • def test_terminator_stateful_conversion
  • with_tmpdir {
  •  src = "before \e$B\x23\x30\x23\x31\e(B
    

after".force_encoding(“iso-2022-jp”)

  •  generate_file('tmp', src)
    
  •  s = open("tmp", "r:iso-2022-jp:euc-jp") {|f|
    
  •    f.gets("0".force_encoding("euc-jp"))
    
  •  }
    
  •  assert_equal(Encoding.find("euc-jp"), s.encoding)
    
  •  assert_str_equal(src.encode("euc-jp"), s)
    
  • }
  • end
    +end

+class TestTranscode_PENDING < Test::Unit::TestCase

  • def test_euc_jis_x_0212
  • assert_equal("\u9299", “\x1b$(Dd!\x1b(B”.encode(“utf-8”,
    “iso-2022-jp”)) # JIS X 0212 e$B6he(B68 [email protected](B01 ?
  • assert_equal("\x1b$(Dd!\x1b(B".force_encoding(“iso-2022-jp”),
    “\u9299”.encode(“iso-2022-jp”))
  • end
    +end

In article
[email protected],
“Yusuke ENDOH” [email protected] writes:

  • test_getc_stateful_conversion(TestIO_M17N)
  • test_terminator_stateful_conversion(TestIO_M17N)
    • stateful encoding e$B$OEvJ,%5%]!<%H$5$l$J$$e(B

transcode e$B$Oe(B stateful encoding e$B$r%5%]!<%H$7;O$a$F$$$^$9$h!#e(B

% ruby -ve ‘p “\e$BCC”.force_encoding(“iso-2022-jp”).encode(“euc-jp”)’
ruby 1.9.0 (2008-07-22 revision 18153) [i686-linux]
“e$BCCe(B”

2008/07/25 1:02 Tanaka A. [email protected]:

In article [email protected],
“Yusuke ENDOH” [email protected] writes:

  • test_getc_stateful_conversion(TestIO_M17N)
  • test_terminator_stateful_conversion(TestIO_M17N)
    • stateful encoding e$B$OEvJ,%5%]!<%H$5$l$J$$e(B

transcode e$B$Oe(B stateful encoding e$B$r%5%]!<%H$7;O$a$F$$$^$9$h!#e(B

e$B!V%5%]!<%H$5$l$J$$%(%s%3!<%G%#%s%0$J$N$Ge(B ISO-2022-JP
[email protected]$Oe(B
e$BITDj$G$"$j!"e(Btranscode
e$B$O0lIt$,6vA3$&$^$/F0$$$F$$$k$K2a$.$J$$!W$H;d$Oe(B
e$BM}2r$7$F$$$^$7$?!#e(B

e$B$,!"@[email protected]%$5$s$+e(B Martin [email protected]<Ae(B
(e$B$H!"[email protected]=$5$l$?8x<0$N%I%-%e%a%s%He(B)
e$B$,M_$7$$$G$9!#e(B

e$B!V%5%]!<%H$5$l$J$$!W$HM}2r$7$?:,5r$O!"@[email protected]%$5$s$NF|:"$NH/[email protected]$H!"$k$j$^$G$9!#e(B

http://doc.loveruby.net/refm/api/view/spec/m17n

[email protected]@%$G$9!#e(B

Yusuke ENDOH wrote:

e$B!V%5%]!<%H$5$l$J$$%(%s%3!<%G%#%s%0$J$N$Ge(B ISO-2022-JP [email protected]$Oe(B
e$BITDj$G$"$j!"e(Btranscode e$B$O0lIt$,6vA3$&$^$/F0$$$F$$$k$K2a$.$J$$!W$H;d$Oe(B
e$BM}2r$7$F$$$^$7$?!#e(B

e$B$,!"@[email protected]%$5$s$+e(B Martin [email protected]<Ae(B (e$B$H!"[email protected]=$5$l$?8x<0$N%I%-%e%a%s%He(B)
e$B$,M_$7$$$G$9!#e(B

e$B!V%5%]!<%H$5$l$J$$!W$HM}2r$7$?:,5r$O!"@[email protected]%$5$s$NF|:"$NH/[email protected]$H!"$k$j$^$G$9!#e(B

enc e$B$H$$$&$+54<V$H$$$&$+!"e(BString e$B%/%i%[email protected],I=8=$H$$$C$?e(B
Ruby M17N e$BK\BN$G$Oe(B
stateful encoding e$B$O%5%]!<%H$7$^$;$s!#e(B

e$B0lJ}$G!"e(Btranscode e$B$O$=$l$H$OJL$N;EAH$_$J$N$GFHN)$7$F$$$^$9!#e(B

transcode e$BE*$K$O!"e(Bstateful encoding e$B$Oe(B restartable
e$B$K8=>u$J$i$J$$$?$a$K!"e(B
getc [email protected]$9$3$H$,$G$-$^$;$s!#e(B
e$BJ8;zC10L$Ne(B restart e$B$Oe(B 1.9.1 e$B$G$O%5%]!<%H$7$^$;$s!#e(B

e$B9TC10L$Ne(B restart e$B$Oe(B ISO-2022-JP e$B$de(B UTF-7
e$B$O2DG=$J5$$,$7$^$9!#e(B
e$B$D$^$k$H$3$m!"e(Bdecode e$B$7$J$/$F$b2~9T$NG’<1$,2DG=$Je(B encoding
e$B$K$D$$$F$O!"e(B
gets e$B$r%5%]!<%H$9$kJ}8~$G$9!#e(B

e$BA4It0l5$$KFI$_$3$`>l9g$O%5%]!<%H$7$^$9!#e(B

e$B$^$H$a$k$H!"e(B

  • getc, ungetc e$B!_e(B
  • gets e$B!{e(B
  • read e$B!{e(B
    e$B0J>e$N$h$&$J8BDjE*$J%5%]!<%H$,Ds6!$5$l$kM=Dj$G$9!#e(B

In article
[email protected],
“Yusuke ENDOH” [email protected] writes:

e$B!V%5%]!<%H$5$l$J$$%(%s%3!<%G%#%s%0$J$N$Ge(B ISO-2022-JP [email protected]$Oe(B
e$BITDj$G$"$j!"e(Btranscode e$B$O0lIt$,6vA3$&$^$/F0$$$F$$$k$K2a$.$J$$!W$H;d$Oe(B
e$BM}2r$7$F$$$^$7$?!#e(B

e$B$,!"@[email protected]%$5$s$+e(B Martin [email protected]<Ae(B (e$B$H!"[email protected]=$5$l$?8x<0$N%I%-%e%a%s%He(B)
e$B$,M_$7$$$G$9!#e(B

http://pub.cozmixng.org/~the-rwiki/rw-cgi.rb?cmd=view;name=m17nQuestions
e$B$Ke(B

e$B!&e(B IO e$B$Ke(B ISO-2022-JP
e$B$J$I$N%9%F!<%H%U%k$J%(%s%3!<%G%#%s%0$r;XDj$G$-$ke(B?
e$B"“e(B matz:
e$B30B&$N%(%s%3!<%G%#%s%0$K$O%9%F!<%H%U%k$J%(%s%3!<%G%#%s%0$b;XDj$G$-$^$9e(B
e$B”"e(B e$B!Ve(Bopen(path, “r:iso-2022-jp:euc-jp”)e$B!W$H$+e(B

e$B$H$"$k$h$&$K!"F0:n$9$k$3$H$,4|BT$5$l$^$9!#e(B

e$B!V%5%]!<%H$5$l$J$$!W$HM}2r$7$?:,5r$O!"@[email protected]%$5$s$NF|:"$NH/[email protected]$H!"$k$j$^$G$9!#e(B

http://doc.loveruby.net/refm/api/view/spec/m17n

e$B%@%_!<%(%s%3!<%G%#%s%0e(B
e$B%5%]!<%H$7$^$;$s!#e(BRuby e$B$O%(%s%3!<%G%#%s%0$NL>[email protected]$1CN$C$F$$$k>uBV$G$9!#e(BISO-2022-JP, UTF-7 e$B$,$3$l$K$"$?$j$^$9!#e(B

e$B$3$l$Oe(B IO
e$B$N30B&$N%(%s%3!<%G%#%s%0$K$OE,MQ$5$l$J$$$H;W$$$^$9!#e(B

In article [email protected],
“Yusuke ENDOH” [email protected] writes:

2008/07/25 2:41 NARUSE, Yui [email protected]:

e$B9TC10L$Ne(B restart e$B$Oe(B ISO-2022-JP e$B$de(B UTF-7 e$B$O2DG=$J5$$,$7$^$9!#e(B
e$B$D$^$k$H$3$m!"e(Bdecode e$B$7$J$/$F$b2~9T$NG’<1$,2DG=$Je(B encoding e$B$K$D$$$F$O!"e(B
gets e$B$r%5%]!<%H$9$kJ}8~$G$9!#e(B

test_terminator_stateful_conversion(TestIO_M17N) e$B$N$h$&$K!“e(Bgets e$B$Ke(B
e$B%G%j%_%?$r;XDj$9$k$h$&$J$N$b!”%5%]!<%HBP>]30$G$9$h$M!#$?$V$s!#e(B

e$B$J$s$G%5%]!<%HBP>]30$J$s$G$9$+e(B?

e$B1sF#$G$9!#e(B

2008/07/25 2:41 NARUSE, Yui [email protected]:

e$B9TC10L$Ne(B restart e$B$Oe(B ISO-2022-JP e$B$de(B UTF-7 e$B$O2DG=$J5$$,$7$^$9!#e(B
e$B$D$^$k$H$3$m!"e(Bdecode e$B$7$J$/$F$b2~9T$NG’<1$,2DG=$Je(B encoding e$B$K$D$$$F$O!"e(B
gets e$B$r%5%]!<%H$9$kJ}8~$G$9!#e(B

test_terminator_stateful_conversion(TestIO_M17N) e$B$N$h$&$K!“e(Bgets
e$B$Ke(B
e$B%G%j%_%?$r;XDj$9$k$h$&$J$N$b!”%5%]!<%HBP>]30$G$9$h$M!#$?$V$s!#e(B

e$B%5%]!<%HBP>]30$NMW5a$KBP$7$F$Oe(B NotImplementedError
e$B$rEj$2$k$N$Oe(B
e$B$I$&$G$7$g$&$+!#$3$l$J$i$=$l$J$j$K%F%9%H$,=q$1$=$&$G$9!#e(B

Index: io.c

— io.c (revision 18257)
+++ io.c (working copy)
@@ -323,11 +323,17 @@
return;
}

+static rb_encoding *io_input_encoding(rb_io_t *fptr);
+
static void
io_ungetc(VALUE str, rb_io_t *fptr)
{
int len = RSTRING_LEN(str);

  • if (rb_enc_dummy_p(io_input_encoding(fptr))) {

  • rb_raise(rb_eNotImpError, “ungetc against dummy encoding is not
    currently supported”);

  • }

  • if (fptr->rbuf == NULL) {
    fptr->rbuf_off = 0;
    fptr->rbuf_len = 0;
    @@ -1950,6 +1956,9 @@

    GetOpenFile(io, fptr);
    rb_io_check_readable(fptr);

  • if (rb_enc_dummy_p(io_input_encoding(fptr)) && rs != rb_default_rs)
    {

  • rb_raise(rb_eNotImpError, “gets with delimiter against dummy
    encoding is not currently supported”);

  • }
    if (NIL_P(rs)) {
    str = read_all(fptr, 0, Qnil);
    if (RSTRING_LEN(str) == 0) return Qnil;
    @@ -2265,6 +2274,10 @@
    int r, n, cr = 0;
    VALUE str;

  • if (rb_enc_dummy_p(enc)) {

  • rb_raise(rb_eNotImpError, “getc against dummy encoding is not
    currently supported”);

  • }

  • if (io_fillbuf(fptr) < 0) {
    return Qnil;
    }
    Index: test/ruby/test_io_m17n.rb
    ===================================================================
    — test/ruby/test_io_m17n.rb (revision 18257)
    +++ test/ruby/test_io_m17n.rb (working copy)
    @@ -161,11 +161,13 @@
    with_tmpdir {
    src = “before \e$B\x23\x30\x23\x31\e(B
    after”.force_encoding(“iso-2022-jp”)
    generate_file(‘tmp’, src)

  •  s = open("tmp", "r:iso-2022-jp:euc-jp") {|f|
    
  •    f.gets("0".force_encoding("euc-jp"))
    
  •  }
    
  •  assert_equal(Encoding.find("euc-jp"), s.encoding)
    
  •  assert_str_equal(src.encode("euc-jp"), s)
    
  •  assert_raise(NotImplementedError) do
    
  •    s = open("tmp", "r:iso-2022-jp:euc-jp") {|f|
    
  •      f.gets("0".force_encoding("euc-jp"))
    
  •    }
    
  •    assert_equal(Encoding.find("euc-jp"), s.encoding)
    
  •    assert_str_equal(src.encode("euc-jp"), s)
    
  •  end
    
    }
    end

@@ -218,13 +220,30 @@
with_tmpdir {
src = “\e$B\x23\x30\x23\x31\e(B”.force_encoding(“iso-2022-jp”)
generate_file(‘tmp’, src)

  •  open("tmp", "r:iso-2022-jp:euc-jp") {|f|
    
  •    assert_equal("\xa3\xb0".force_encoding("euc-jp"), f.getc)
    
  •    assert_equal("\xa3\xb1".force_encoding("euc-jp"), f.getc)
    
  •  }
    
  •  assert_raise(NotImplementedError) do
    
  •    open("tmp", "r:iso-2022-jp:euc-jp") {|f|
    
  •      assert_equal("\xa3\xb0".force_encoding("euc-jp"), f.getc)
    
  •      assert_equal("\xa3\xb1".force_encoding("euc-jp"), f.getc)
    
  •    }
    
  •  end
    

    }
    end

  • def test_ungetc_stateful_conversion

  • with_tmpdir {

  •  src = "before \e$B\x23\x30\x23\x31\e(B
    

after".force_encoding(“iso-2022-jp”)

  •  generate_file('tmp', src)
    
  •  assert_raise(NotImplementedError) do
    
  •    s = open("tmp", "r:iso-2022-jp:euc-jp") {|f|
    
  •      f.ungetc("0".force_encoding("euc-jp"))
    
  • f.read
  •    }
    
  •    assert_equal(Encoding.find("euc-jp"), s.encoding)
    
  •    assert_str_equal(("0" + src).encode("euc-jp"), s)
    
  •  end
    
  • }
  • end
  • def test_open_ascii
    with_tmpdir {
    src = “abc\n”

On Wed, 30 Jul 2008 19:10:29 +0900
In article [email protected]
[[ruby-dev:35695] Re: PENDINGS.rb (Was: Re: [Ruby 1.9 - Bug #354]
(Assigned) Test failure test/ruby/test_transcode.rb)]
“Yusuke ENDOH” [email protected] wrote:

e$B$3$l$G$O2~9TJ8;z$,G’<[email protected]$,$"$k$N$G!"e(BUTF-7 e$B$KBP$9$ke(B
gets [email protected];$7$J$1$l$P$J$i$J$$$H;W$$$^$9!#e(B
e$B$=$l$J$i$$$C$=e(B dummy encoding e$B$KBP$9$ke(B gets e$B$O$9$Y$F6X;
$7$A$c$(!"e(B
e$B$H$$$&$N$,;d$N0U8+$G$9!#e(B

UTF-7 e$B$Ge(B (CR)LF
e$B$,%(%s%3!<%I$5$l$F$$$F$b!JEvLL$O!)!KG’<1$7$^$;$s$h!"$H$$e(B
e$B$&$3$H$G$$$$$s$8$c$J$$$G$7$g$&$+!#e(B

e$B$[$s$H!"e(BUTF-7 e$B$F7y$J%(%s%3!<%G%#%s%[email protected]!D!De(B

e$B1sF#$G$9!#e(B

2008/07/30 7:33 Tanaka A. [email protected]:

e$B$J$s$G%5%]!<%HBP>]30$J$s$G$9$+e(B?

e$B2~9T$NG’<[email protected]$C$?$N$G!"$=$&$$$&A0Ds$+$H8mFI$7$F$^$7$?!#e(B

e$B$A$g$C$He(B UTF-7 e$B$rD4$Y$F$_$?$s$G$9$,!"e(BRFC 2152
e$B$K$h$k$HG$0U$NJ8;z$re(B
BASE64 e$B$G%(%s%3!<%I$7$F$b$$$$$h$&$G$9!#e(B

$ echo foo+AAo-bar | iconv -f=UTF-7 -t=UTF-8 | od -c
0000000 f o o \n b a r \n
0000010

e$B$3$l$G$O2~9TJ8;z$,G’<[email protected]$,$"$k$N$G!"e(BUTF-7
e$B$KBP$9$ke(B
gets [email protected];$7$J$1$l$P$J$i$J$$$H;W$$$^$9!#e(B
e$B$=$l$J$i$$$C$=e(B dummy encoding e$B$KBP$9$ke(B gets
e$B$O$9$Y$F6X;
$7$A$c$(!"e(B
e$B$H$$$&$N$,;d$N0U8+$G$9!#e(B

e$B$,!"$I$&$7$F$be(B ISO-2022-JP e$B$Ge(B gets
e$B$7$?$$$H$$$&<{MW$,L5;k$G$-$J$$e(B
e$B$N$G$7$?$i!"e(Bgets e$B$Ge(B ISO-2022-JP
[email protected]$1FCJL07$$$9$k$N$O$I$&$G$7$g$&!#e(B
IO e$B$,e(B stateful encoding e$B$r%5%]!<%H$9$kF|$^$G$Ne(B workaround
e$B$G$9!#e(B

ESC [email protected])8fJ8;[email protected]$1$+$i$J$k%G%j%_%[email protected]$1$ODL$9$h$&$K$7$^$7$?!#e(B

Index: io.c

— io.c (revision 18264)
+++ io.c (working copy)
@@ -1956,8 +1956,23 @@

 GetOpenFile(io, fptr);
 rb_io_check_readable(fptr);
  • if (rb_enc_dummy_p(io_input_encoding(fptr)) && rs != rb_default_rs)
    {
  • rb_raise(rb_eNotImpError, “gets with delimiter against dummy
    encoding is not currently supported”);
  • /* FIXME! please support stateful encoding */
  • if (rb_enc_dummy_p(io_input_encoding(fptr))) {
  • const char *name = rb_enc_name(io_input_encoding(fptr));
  • if ((strcmp(name, “ISO-2022-JP”) == 0 || strcmp(name, “ISO2022-JP”)
    == 0 ||
  •   strcmp(name, "ISO-2022-JP2") == 0 || strcmp(name, "ISO2022-JP2") 
    

== 0) &&

  •  !NIL_P(rs) && rs != rb_default_rs) {
    
  •  int i;
    
  •  for (i = 0; i < RSTRING_LEN(rs); i++) {
    
  • char c = RSTRING_PTR(rs)[i];
  • if (c == 0x1b || 0x20 <= c) {
  •    rb_raise(rb_eNotImpError, "gets against dummy encoding is not
    

currently supported");

  • }
  •  }
    
  • }
  • else {
  •  rb_raise(rb_eNotImpError, "gets against dummy encoding is not
    

currently supported");

  • }
    }
    if (NIL_P(rs)) {
    str = read_all(fptr, 0, Qnil);

e$B1sF#$G$9!#e(B

2008/07/30 20:24 Tanaka A. [email protected]:

In article [email protected],
“Yusuke ENDOH” [email protected] writes:

e$B$3$l$G$O2~9TJ8;z$,G’<[email protected]$,$"$k$N$G!"e(BUTF-7 e$B$KBP$9$ke(B
gets [email protected];$7$J$1$l$P$J$i$J$$$H;W$$$^$9!#e(B
e$B$=$l$J$i$$$C$=e(B dummy encoding e$B$KBP$9$ke(B gets e$B$O$9$Y$F6X;
$7$A$c$(!"e(B
e$B$H$$$&$N$,;d$N0U8+$G$9!#e(B

ISO-2022-JP e$B$G$be(B UTF-7 e$B$G$b!"JQ49$7$F$+$i2~9TJ8;z$rG’<1$9$ke(B
e$B$h$&$K$9$l$P$$$$$N$G$Oe(B?

e$B$J$k$[$I!#e(B

e$B$=$N$?$a$K$O!“e(Btranscode e$B$,$b$C$H$^$H$b$JJQ49e(B API e$B$rDs6!$9$ke(B
e$BI,MW$,$”$j$^$9e(B

e$B$b$&e(B 1.9.1 e$B$K$O4V$K9g$o$J$$$H$$$o$l$F$$$k$N$G!"$3$l$Oe(B 1.9.2
e$B0J9_$N2]Bj$8$c$J$$$G$7$g$&$+!#e(B1.9.1 e$B$K4V$K9g$($P$=$l$K$3$7$?e(B
e$B$3$H$O$J$$$G$9$,!"Mn$H$7$I$3$m$r8+$D$1$F2>$N;EMM$H$7$F$*$$$?e(B
e$BJ}$,$$$$$H;W$$$^$9!#e(B

e$B1sF#$G$9!#e(B

2008/07/30 19:41 Tietew [email protected]:

UTF-7 e$B$Ge(B (CR)LF e$B$,%(%s%3!<%I$5$l$F$$$F$b!JEvLL$O!)!KG’<1$7$^$;$s$h!"$H$$e(B
e$B$&$3$H$G$$$$$s$8$c$J$$$G$7$g$&$+!#e(B

e$B$J$k$[$I!#%G%j%_%?$r;XDj$7$?>l9g$O$I$&$G$7$g$&$+!#e(B

  • e$B%G%j%_%?$,%(%s%3!<%I$5$l$F$$$F$bG’<1$7$^$;$s$he(B
  • e$B%G%j%_%?$HF1$8J8;zNs$,%(%s%3!<%I>[email protected]$j$^$9$he(B

e$B$H$$$&$N$,:#$^$G$N<BAu$G$9!#;d$NM}2r$,@5$7$1$l$P!#e(B

e$B$3$l$,;EMM$G$$$$$J$i!“e(BISO-2022-JP e$B$KBP$9$ke(B gets
e$B$,JQ$J$H$3$m$Ge(B
[email protected]$l$k$N$b;EMM$C$F$3$H$G!”%F%9%H$rD>$7$F=*$o$j$G$9!#e(B

e$B8D?ME*[email protected]$C$FM_$7$$$G$9$1$I!#e(B

In article
[email protected],
“Yusuke ENDOH” [email protected] writes:

e$B$3$l$G$O2~9TJ8;z$,G’<[email protected]$,$"$k$N$G!"e(BUTF-7 e$B$KBP$9$ke(B
gets [email protected];$7$J$1$l$P$J$i$J$$$H;W$$$^$9!#e(B
e$B$=$l$J$i$$$C$=e(B dummy encoding e$B$KBP$9$ke(B gets e$B$O$9$Y$F6X;
$7$A$c$(!"e(B
e$B$H$$$&$N$,;d$N0U8+$G$9!#e(B

ISO-2022-JP e$B$G$be(B UTF-7 e$B$G$b!"JQ49$7$F$+$i2~9TJ8;z$rG’<1$9$ke(B
e$B$h$&$K$9$l$P$$$$$N$G$Oe(B?

e$B$=$N$?$a$K$O!“e(Btranscode e$B$,$b$C$H$^$H$b$JJQ49e(B API
e$B$rDs6!$9$ke(B
e$BI,MW$,$”$j$^$9$7!"$=$m$=$me(B Martin e$B$5$s$K4|BT$9$k$N$O$d$a$k$[e(B
e$B$&$,$$$$$+$b$7$l$^$;$s$,!#e(B

On Wed, 30 Jul 2008 20:44:36 +0900
In article [email protected]
[[ruby-dev:35698] Re: PENDINGS.rb (Was: Re: [Ruby 1.9 - Bug #354]
(Assigned) Test failure test/ruby/test_transcode.rb)]
“Yusuke ENDOH” [email protected] wrote:

ISO-2022-JP e$B$G$be(B UTF-7 e$B$G$b!"JQ49$7$F$+$i2~9TJ8;z$rG’<1$9$ke(B
e$B$h$&$K$9$l$P$$$$$N$G$Oe(B?

e$B$J$k$[$I!#e(B

ruby workaround e$B$H$7$F$O!"e(B
open(file, “r:utf-7:utf-8”) do |f|
f = StringIO.new(f.read) # e$BJQ49e(B
while line = f.gets # [email protected]$7$/F0$/e(B
# I am happy
end
end

e$B$F$J46$8$G$9$h$M!#Bg$-$$%U%!%$%k$N$3$H$O9M$($F$$$^$;$s$,!#e(B

e$B$=$N$?$a$K$O!“e(Btranscode e$B$,$b$C$H$^$H$b$JJQ49e(B API e$B$rDs6!$9$ke(B
e$BI,MW$,$”$j$^$9e(B

e$B$b$&e(B 1.9.1 e$B$K$O4V$K9g$o$J$$$H$$$o$l$F$$$k$N$G!"$3$l$Oe(B 1.9.2
e$B0J9_$N2]Bj$8$c$J$$$G$7$g$&$+!#e(B1.9.1 e$B$K4V$K9g$($P$=$l$K$3$7$?e(B
e$B$3$H$O$J$$$G$9$,!"Mn$H$7$I$3$m$r8+$D$1$F2>$N;EMM$H$7$F$*$$$?e(B
e$BJ}$,$$$$$H;W$$$^$9!#e(B

e$B8=>u0];}!J%9%F!<%H%U%k$N$3$H$O9MN830!K$G$$$$$s$8$c$J$$$+$H;W$$$^$9!#e(B
[email protected]$l$F$b!V$"$H$GD>$9M=Dj!W$H$$$&$3$H$G!#e(B

e$B1sF#$G$9!#e(B

2008/07/30 21:39 Tietew [email protected]:

e$B$=$N$?$a$K$O!“e(Btranscode e$B$,$b$C$H$^$H$b$JJQ49e(B API e$B$rDs6!$9$ke(B
e$BI,MW$,$”$j$^$9e(B

e$B$b$&e(B 1.9.1 e$B$K$O4V$K9g$o$J$$$H$$$o$l$F$$$k$N$G!"$3$l$Oe(B 1.9.2
e$B0J9_$N2]Bj$8$c$J$$$G$7$g$&$+!#e(B1.9.1 e$B$K4V$K9g$($P$=$l$K$3$7$?e(B
e$B$3$H$O$J$$$G$9$,!"Mn$H$7$I$3$m$r8+$D$1$F2>$N;EMM$H$7$F$*$$$?e(B
e$BJ}$,$$$$$H;W$$$^$9!#e(B

e$B8=>u0];}!J%9%F!<%H%U%k$N$3$H$O9MN830!K$G$$$$$s$8$c$J$$$+$H;W$$$^$9!#e(B
[email protected]$l$F$b!V$"$H$GD>$9M=Dj!W$H$$$&$3$H$G!#e(B

e$B>o<1E*$J%G!<%?$KBP$7$F$O8=>u$G$&$^$/F0$-$=$&$J$N$G!"$=$N$^$^$Ke(B
e$B$7$F$*$$$F$[$7$$!"$H$$$&$3$H$G$9$+$M!#e(B
e$B$"$^$j9%$-$8$c$J$$$G$9$,!“6/$/H?BP$O$7$^$;$s!#e(B
e$B$3$l$,:NBr$5$l$k$J$i!”$=$l$K$"$o$;$F%F%9%H$rJQ$($h$&$H;W$$$^$9!#e(B

e$B$U$H;W$C$?$N$G$9$,!"$3$NCfESH>C<$J;EMM$,@H<[email protected]$NM60x$K$J$k$3$H$Oe(B
e$B$J$$$G$9$h$M!)e(B

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs