From ba9094308899ad9a6891e9739c2d7a51a851e7e0 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 7 May 2002 07:09:02 +0000 Subject: * ext/iconv/iconv.c (iconv_try): should initialize exceptions properly. (ruby-bugs-ja:PR#232) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ ext/iconv/iconv.c | 17 ++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index f0d72be0c1..413c8c9dee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue May 7 15:41:33 2002 Nobuyoshi Nakada + + * ext/iconv/iconv.c (iconv_try): should initialize exceptions + properly. (ruby-bugs-ja:PR#232) + Tue May 7 15:28:03 2002 Minero Aoki * eval.c (rb_yield_0): The destination of the goto jump was wrong. diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c index bf1528d21a..2366a350cc 100644 --- a/ext/iconv/iconv.c +++ b/ext/iconv/iconv.c @@ -159,16 +159,16 @@ iconv_try /* try the left in next loop */ break; case EILSEQ: - return rb_obj_alloc(rb_eIconvIllegalSeq); + return rb_class_new_instance(0, 0, rb_eIconvIllegalSeq); case EINVAL: - return rb_obj_alloc(rb_eIconvInvalidChar); + return rb_class_new_instance(0, 0, rb_eIconvInvalidChar); default: rb_sys_fail("iconv"); } } else if (*inlen > 0) { /* something goes wrong */ - return rb_obj_alloc(rb_eIconvIllegalSeq); + return rb_class_new_instance(0, 0, rb_eIconvIllegalSeq); } return Qfalse; } @@ -341,7 +341,7 @@ iconv_convert */ /* =begin ---- Iconv.new(to, from) +--- Iconv.new(to, from) {|cd| ...} Creates new code converter from a coding-system designated with ((|from|)) to another one designated with ((|to|)). :Parameters @@ -418,7 +418,7 @@ iconv_s_open =begin --- Iconv.iconv(to, from, *strs) Shorthand for - Iconv.open(to, from) {|cd| (strs + nil).collect {|s| cd.iconv(s)}} + Iconv.open(to, from) {|cd| (strs + [nil]).collect {|s| cd.iconv(s)}} :Parameters :((|to|)), ((|from|)) see (()). @@ -661,14 +661,17 @@ iconv_failure_inspect =begin == Iconv::IllegalSequence -Exception in the case of any illegal sequence detected. +Input conversion stopped due to an input byte that does not belong to +the input codeset, or the output codeset does not contain the +character. === Superclass (({ArgumentError})) === Included Modules (()) == Iconv::InvalidCharacter -Exception in the case of output coding system can't express the character. +Input conversion stopped due to an incomplete character or shift +sequence at the end of the input buffer. === Superclass (({ArgumentError})) === Included Modules -- cgit v1.2.3