Add "Error" suffix for Encoding Exceptions

e$B:XF#$H?=$7$^$9!#e(B

Encodinge$B%/%i%9$K$O!";0$D$NNc30%/%i%9e(B

  • ConversionUndefined
  • InvalidByteSequence
  • NoConverter

e$B$,$"$j$^$9$,!"$3$l$i$O:G8e$K!Ve(BErrore$B!W$,IU$$$F$$$^$;$s!#e(B

e$B$[$H$s$I$NAH$_9~$_Nc30%/%i%9$K!Ve(BErrore$B!W$,IU$$$F$$$k$3$H$+$i!"5,Ls$NNc30$r8:$i$9e(B
e$B0UL#$G$b!"0lL$GNc30$@$HJ,$+$k$H$$$&0UL#$G$b!“KvHx$Ke(BErrore$B$rIU2C$7$?J}$,$h$$$He(B
e$B46$8$?$N$G$9$,!”$I$&$G$7$g$&$+!#e(B

Index: …/transcode.c

— …/transcode.c (revision 19395)
+++ …/transcode.c (working copy)
@@ -14,9 +14,9 @@
#include “transcode_data.h”
#include <ctype.h>

-VALUE rb_eConversionUndefined;
-VALUE rb_eInvalidByteSequence;
-VALUE rb_eNoConverter;
+VALUE rb_eConversionUndefinedError;
+VALUE rb_eInvalidByteSequenceError;
+VALUE rb_eNoConverterError;

VALUE rb_cEncodingConverter;

@@ -1960,7 +1960,7 @@
mesg = rb_str_new_cstr(“code converter not found (”);
econv_description(sname, dname, ecflags, mesg);
rb_str_cat2(mesg, “)”);

  • exc = rb_exc_new3(rb_eNoConverter, mesg);
  • exc = rb_exc_new3(rb_eNoConverterError, mesg);
    return exc;
    }

@@ -1997,7 +1997,7 @@
ec->last_error.source_encoding);
}

  •    exc = rb_exc_new3(rb_eInvalidByteSequence, mesg);
    
  •    exc = rb_exc_new3(rb_eInvalidByteSequenceError, mesg);
       rb_ivar_set(exc, rb_intern("error_bytes"), bytes);
       rb_ivar_set(exc, rb_intern("readagain_bytes"), bytes2);
       rb_ivar_set(exc, rb_intern("incomplete_input"), 
    

ec->last_error.result == econv_incomplete_input ? Qtrue : Qfalse);
@@ -2023,7 +2023,7 @@
StringValueCStr(dumped),
ec->last_error.source_encoding,
ec->last_error.destination_encoding);

  •    exc = rb_exc_new3(rb_eConversionUndefined, mesg);
    
  •    exc = rb_exc_new3(rb_eConversionUndefinedError, mesg);
       idx = rb_enc_find_index(ec->last_error.source_encoding);
       if (0 <= idx)
           rb_enc_associate_index(bytes, idx);
    

@@ -3367,8 +3367,8 @@

  • puts ec.finish.dump #=>
    “\e(B”.force_encoding(“ISO-2022-JP”)
  • If a conversion error occur,
    • Encoding::ConversionUndefined or
    • Encoding::InvalidByteSequence is raised.
    • Encoding::ConversionUndefinedError or
    • Encoding::InvalidByteSequenceError is raised.
    */
    static VALUE
    @@ -3620,7 +3620,7 @@
    • some bytes are buffered to be converted later.
    • The latter bytes can be put back.
    • It can be observed by
    • Encoding::InvalidByteSequence#readagain_bytes and
    • Encoding::InvalidByteSequenceError#readagain_bytes and
    • Encoding::Converter#primitive_errinfo.
    • ec = Encoding::Converter.new(“utf-16le”, “iso-8859-1”)
      @@ -3669,14 +3669,14 @@
    • It returns nil if the last conversion is not an error.
    • “error” means that
    • Encoding::InvalidByteSequence and Encoding::ConversionUndefined for
    • Encoding::InvalidByteSequenceError and
      Encoding::ConversionUndefinedError for
    • Encoding::Converter#convert and
    • :invalid_byte_sequence, :incomplete_input and :undefined_conversion
      for
    • Encoding::Converter#primitive_convert.
    • ec = Encoding::Converter.new(“utf-8”, “iso-8859-1”)
    • p ec.primitive_convert(src="\xf1abcd", dst="") #=>
      :invalid_byte_sequence
    • p ec.last_error #=> #<Encoding::InvalidByteSequence: “\xF1”
      followed by “a” on UTF-8>
    • p ec.last_error #=> #<Encoding::InvalidByteSequenceError:
      “\xF1” followed by “a” on UTF-8>
    • p ec.primitive_convert(src, dst, nil, 1) #=>
      :destination_buffer_full
    • p ec.last_error #=> nil

@@ -3714,7 +3714,7 @@

 ret = make_replacement(ec);
 if (ret == -1) {
  •    rb_raise(rb_eConversionUndefined, "replacement character setup 
    

failed");

  •    rb_raise(rb_eConversionUndefinedError, "replacement character 
    

setup failed");
}

 enc = rb_enc_find(ec->replacement_enc);

@@ -3748,8 +3748,8 @@
rb_enc_name(enc));

 if (ret == -1) {
  •    /* xxx: rb_eInvalidByteSequence? */
    
  •    rb_raise(rb_eConversionUndefined, "replacement character setup 
    

failed");

  •    /* xxx: rb_eInvalidByteSequenceError? */
    
  •    rb_raise(rb_eConversionUndefinedError, "replacement character 
    

setup failed");
}

 return arg;

@@ -3790,7 +3790,7 @@

  • ec = Encoding::Converter.new(“ISO-8859-1”, “EUC-JP”) # ISO-8859-1
    -> UTF-8 -> EUC-JP
  • begin
  • ec.convert("\xa0") # NO-BREAK SPACE, which is available in UTF-8
    but not in EUC-JP.
    • rescue Encoding::ConversionUndefined
    • rescue Encoding::ConversionUndefinedError
    • p $!.source_encoding #=> #Encoding:UTF-8
    • p $!.destination_encoding #=> #Encoding:EUC-JP
    • p $!.source_encoding_name #=> “UTF-8”
      @@ -3832,12 +3832,12 @@
    • call-seq:
    • ecerr.error_char -> string
    • returns the one-character string which cause
      Encoding::ConversionUndefined.
    • returns the one-character string which cause
      Encoding::ConversionUndefinedError.
    • ec = Encoding::Converter.new(“ISO-8859-1”, “EUC-JP”)
    • begin
    • ec.convert("\xa0")
    • rescue Encoding::ConversionUndefined
    • rescue Encoding::ConversionUndefinedError
    • puts $!.error_char.dump #=> “\xC2\xA0”
    • p $!.error_char.encoding #=> #Encoding:UTF-8
    • end
      @@ -3853,13 +3853,13 @@
    • call-seq:
    • ecerr.error_bytes -> string
    • returns the discarded bytes when Encoding::InvalidByteSequence
      occur.
    • returns the discarded bytes when Encoding::InvalidByteSequenceError
      occur.
    • ec = Encoding::Converter.new(“EUC-JP”, “ISO-8859-1”)
    • begin
    • ec.convert(“abc\xA1\xFFdef”)
    • rescue Encoding::InvalidByteSequence
    • p $! #=> #<Encoding::InvalidByteSequence: “\xA1” followed by
      “\xFF” on EUC-JP>
    • rescue Encoding::InvalidByteSequenceError
    • p $! #=> #<Encoding::InvalidByteSequenceError: “\xA1”
      followed by “\xFF” on EUC-JP>
    • puts $!.error_bytes.dump #=> “\xA1”
    • puts $!.readagain_bytes.dump #=> “\xFF”
    • end
      @@ -3874,7 +3874,7 @@
    • call-seq:
    • ecerr.readagain_bytes -> string
    • returns the bytes to be read again when
      Encoding::InvalidByteSequence occur.
    • returns the bytes to be read again when
      Encoding::InvalidByteSequenceError occur.
      */
      static VALUE
      ecerr_readagain_bytes(VALUE self)
      @@ -3893,16 +3893,16 @@
    • begin
    • ec.convert(“abc\xA1z”)
    • rescue Encoding::InvalidByteSequence
    • p $! #=> #<Encoding::InvalidByteSequence: “\xA1” followed by
      “z” on EUC-JP>
    • rescue Encoding::InvalidByteSequenceError
    • p $! #=> #<Encoding::InvalidByteSequenceError: “\xA1”
      followed by “z” on EUC-JP>
    • p $!.incomplete_input? #=> false
    • end
    • begin
    • ec.convert(“abc\xA1”)
    • ec.finish
    • rescue Encoding::InvalidByteSequence
    • p $! #=> #<Encoding::InvalidByteSequence: incomplete “\xA1”
      on EUC-JP>
    • rescue Encoding::InvalidByteSequenceError
    • p $! #=> #<Encoding::InvalidByteSequenceError: incomplete
      “\xA1” on EUC-JP>
    • p $!.incomplete_input? #=> true
    • end
      */
      @@ -3917,9 +3917,9 @@
      void
      Init_transcode(void)
      {
  • rb_eConversionUndefined = rb_define_class_under(rb_cEncoding,
    “ConversionUndefined”, rb_eStandardError);
  • rb_eInvalidByteSequence = rb_define_class_under(rb_cEncoding,
    “InvalidByteSequence”, rb_eStandardError);
  • rb_eNoConverter = rb_define_class_under(rb_cEncoding,
    “NoConverter”, rb_eStandardError);
  • rb_eConversionUndefinedError = rb_define_class_under(rb_cEncoding,
    “ConversionUndefinedError”, rb_eStandardError);

  • rb_eInvalidByteSequenceError = rb_define_class_under(rb_cEncoding,
    “InvalidByteSequenceError”, rb_eStandardError);

  • rb_eNoConverterError = rb_define_class_under(rb_cEncoding,
    “NoConverterError”, rb_eStandardError);

    transcoder_table = st_init_strcasetable();

@@ -3979,19 +3979,19 @@
rb_define_const(rb_cEncodingConverter,
“XML_ATTR_CONTENT_DECORATOR”,
INT2FIX(ECONV_XML_ATTR_CONTENT_DECORATOR));
rb_define_const(rb_cEncodingConverter, “XML_ATTR_QUOTE_DECORATOR”,
INT2FIX(ECONV_XML_ATTR_QUOTE_DECORATOR));

  • rb_define_method(rb_eConversionUndefined, “source_encoding_name”,
    ecerr_source_encoding_name, 0);
  • rb_define_method(rb_eConversionUndefined,
    “destination_encoding_name”, ecerr_destination_encoding_name, 0);
  • rb_define_method(rb_eConversionUndefined, “source_encoding”,
    ecerr_source_encoding, 0);
  • rb_define_method(rb_eConversionUndefined, “destination_encoding”,
    ecerr_destination_encoding, 0);
  • rb_define_method(rb_eConversionUndefined, “error_char”,
    ecerr_error_char, 0);
  • rb_define_method(rb_eConversionUndefinedError,
    “source_encoding_name”, ecerr_source_encoding_name, 0);
  • rb_define_method(rb_eConversionUndefinedError,
    “destination_encoding_name”, ecerr_destination_encoding_name, 0);
  • rb_define_method(rb_eConversionUndefinedError, “source_encoding”,
    ecerr_source_encoding, 0);
  • rb_define_method(rb_eConversionUndefinedError,
    “destination_encoding”, ecerr_destination_encoding, 0);
  • rb_define_method(rb_eConversionUndefinedError, “error_char”,
    ecerr_error_char, 0);
  • rb_define_method(rb_eInvalidByteSequence, “source_encoding_name”,
    ecerr_source_encoding_name, 0);
  • rb_define_method(rb_eInvalidByteSequence,
    “destination_encoding_name”, ecerr_destination_encoding_name, 0);
  • rb_define_method(rb_eInvalidByteSequence, “source_encoding”,
    ecerr_source_encoding, 0);
  • rb_define_method(rb_eInvalidByteSequence, “destination_encoding”,
    ecerr_destination_encoding, 0);
  • rb_define_method(rb_eInvalidByteSequence, “error_bytes”,
    ecerr_error_bytes, 0);
  • rb_define_method(rb_eInvalidByteSequence, “readagain_bytes”,
    ecerr_readagain_bytes, 0);
  • rb_define_method(rb_eInvalidByteSequence, “incomplete_input?”,
    ecerr_incomplete_input, 0);
  • rb_define_method(rb_eInvalidByteSequenceError,
    “source_encoding_name”, ecerr_source_encoding_name, 0);

  • rb_define_method(rb_eInvalidByteSequenceError,
    “destination_encoding_name”, ecerr_destination_encoding_name, 0);

  • rb_define_method(rb_eInvalidByteSequenceError, “source_encoding”,
    ecerr_source_encoding, 0);

  • rb_define_method(rb_eInvalidByteSequenceError,
    “destination_encoding”, ecerr_destination_encoding, 0);

  • rb_define_method(rb_eInvalidByteSequenceError, “error_bytes”,
    ecerr_error_bytes, 0);

  • rb_define_method(rb_eInvalidByteSequenceError, “readagain_bytes”,
    ecerr_readagain_bytes, 0);

  • rb_define_method(rb_eInvalidByteSequenceError, “incomplete_input?”,
    ecerr_incomplete_input, 0);

    Init_newline();
    }

e$B@.@%$G$9!#e(B

Tadashi S. wrote:

e$B$[$H$s$I$NAH$_9~$_Nc30%/%i%9$K!Ve(BErrore$B!W$,IU$$$F$$$k$3$H$+$i!"5,Ls$NNc30$r8:$i$9e(B
e$B0UL#$G$b!"0lL$GNc30$@$HJ,$+$k$H$$$&0UL#$G$b!“KvHx$Ke(BErrore$B$rIU2C$7$?J}$,$h$$$He(B
e$B46$8$?$N$G$9$,!”$I$&$G$7$g$&$+!#e(B

e$B$o$+$i$J$$$G$b$"$j$^$;$s$,!"L>A0$,D9$9$.$k$s$G!#e(B

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:36356] Re: add “Error” suffix for Encoding
Exceptions”
on Thu, 18 Sep 2008 01:29:56 +0900, “NARUSE, Yui”
[email protected] writes:

|Tadashi S. wrote:
|> e$B:XF#$H?=$7$^$9!#e(B
|>
|> Encodinge$B%/%i%9$K$O!“;0$D$NNc30%/%i%9e(B
|>
|> * ConversionUndefined
|> * InvalidByteSequence
|> * NoConverter
|>
|> e$B$,$”$j$^$9$,!"$3$l$i$O:G8e$K!Ve(BErrore$B!W$,IU$$$F$$$^$;$s!#e(B
|>
|> e$B$[$H$s$I$NAH$_9~$_Nc30%/%i%9$K!Ve(BErrore$B!W$,IU$$$F$$$k$3$H$+$i!"5,Ls$NNc30$r8:$i$9e(B
|> e$B0UL#$G$b!“0lL$GNc30$@$HJ,$+$k$H$$$&0UL#$G$b!“KvHx$Ke(BErrore$B$rIU2C$7$?J}$,$h$$$He(B
|> e$B46$8$?$N$G$9$,!”$I$&$G$7$g$&$+!#e(B
|
|e$B$o$+$i$J$$$G$b$”$j$^$;$s$,!"L>A0$,D9$9$.$k$s$G!#e(B

e$B;d$Oe(BErrore$B$rIU$1$k$N$K;?@.$G$9!#$I$&$;<+J,$G;XDj$9$k$3$H$O$a$Ce(B
e$B$?$K$J$$$s$G!#e(B

Yukihiro M. wrote:

|> * ConversionUndefined

e$B;d$Oe(BErrore$B$rIU$1$k$N$K;?@.$G$9!#$I$&$;<+J,$G;XDj$9$k$3$H$O$a$Ce(B
e$B$?$K$J$$$s$G!#e(B

e$BD9$$$H$$$&0J>e$N0U8+$O$J$$$N$G!"6/$/$OH?BP$7$^$;$s!#e(B

e$B:XF#$H?=$7$^$9!#e(B

On Thu, 18 Sep 2008 01:29:56 +0900
“NARUSE, Yui” [email protected] wrote:

Encodinge$B%/%i%9$K$O!";0$D$NNc30%/%i%9e(B

  • ConversionUndefined
  • InvalidByteSequence
  • NoConverter
    (snip)
    e$B$o$+$i$J$$$G$b$"$j$^$;$s$,!"L>A0$,D9$9$.$k$s$G!#e(B

e$BD9$5$N;v$O9M$($F$$$^$;$s$G$7$?!#e(B

e$B4{B8$Ne(B
EncodingCompatibilityError
e$B$O!“e(B26e$BJ8;z$”$j$^$9!#<+J,$,Ds0F$7$F$$$kCf$GC;$$e(B
Encoding::NoConveter
e$B$HHf3S$9$l$P!“e(B6e$BJ8;zD9$$$G$9!#e(B
e$B$^$?e(B30e$BJ8;z$r1[$($kD9$$<1JL;R$H$J$C$F$b!”$^$D$b$H$5$s$b$$C$7$c$k$H$$j!“e(B
e$BMxMQIQEY$ODc$$Nc30$G$”$k$H;W$$$^$9!#$=$&9M$($k$H!"$I$&$G$7$g$&$+!#e(B

e$B$H$3$m$GOC$,$:$l$^$9$,!"e(B
EncodingCompatibilityError
e$B$He(B
Encoding::ConversionUndefined(Error)
e$B$@$H!“3,AX$,$I$C$A$,$I$C$A$+J,$+$j$E$i$/$”$j$^$;$s$+!#e(B
Encodinge$B$N2<$+$=$&$G$J$$$+!"B7$($?J}$,K>$^$7$$$H;W$$$^$9!#e(B

e$B<+J,$O$I$A$i$+$H8@$($P!":#$^$G$NAH$9~$%/%i%9$HF1$8$/!"e(B::e$B$r!VIU$1$J$$!W$Ke(B
e$B0lI<F~$l$^$9!#e(B

e$B$G$9$,$=$l$h$j$b!"B7$($k$3$H$,=EMW$@$H;W$$$^$9e(B

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:36371] Re: add “Error” suffix for Encoding
Exceptions”
on Thu, 18 Sep 2008 19:42:40 +0900, “Yusuke ENDOH” [email protected]
writes:

|e$B;W$$$D$-$J$s$G$9$,!"e(BEncodingError e$B$H$$$&Nc30$rDj5A$7$F$3$Ne(B 3 e$B$D$re(B
|e$B$=$l$i$N%5%V%/%i%9$K$7$?$i$I$&$G$7$g$&$+!#e(B
|e$BIaDL$Ke(B rescue e$B$9$k$H$-$Oe(B EncodingError e$B$r;XDj$9$l$P$$$$$@$1$H$9$l$P!“e(B
|e$B$=$C$A$NJ}$,3Z$G$9$7!”$3$$$D$i$NL>A0$,D9$/$F$bLdBj$J$$$H;W$$$^$9!#e(B

e$B5$$KF~$j$^$7$?!#e(B

|e$B$b$7!“$3$l$i$NNc30$,0U<1E*$Ke(B rescue e$B$7J,$1$J$$$He(B security issue e$B$Ke(B
|e$B$J$j$+$M$J$$=EMW$J$b$N!”$H$+$@$C$?$i%@%a$G$9$,!#e(B

e$BLdBj$,$"$l$P;XE&$7$F$/$@$5$$!#e(B

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

Encodinge$B%/%i%9$K$O!";0$D$NNc30%/%i%9e(B

  • ConversionUndefined
  • InvalidByteSequence
  • NoConverter
    (snip)
    e$B$o$+$i$J$$$G$b$"$j$^$;$s$,!"L>A0$,D9$9$.$k$s$G!#e(B

e$B;W$$$D$-$J$s$G$9$,!"e(BEncodingError e$B$H$$$&Nc30$rDj5A$7$F$3$Ne(B 3
e$B$D$re(B
e$B$=$l$i$N%5%V%/%i%9$K$7$?$i$I$&$G$7$g$&$+!#e(B
e$BIaDL$Ke(B rescue e$B$9$k$H$-$Oe(B EncodingError
e$B$r;XDj$9$l$P$$$$$@$1$H$9$l$P!“e(B
e$B$=$C$A$NJ}$,3Z$G$9$7!”$3$$$D$i$NL>A0$,D9$/$F$bLdBj$J$$$H;W$$$^$9!#e(B

e$B$b$7!"$3$l$i$NNc30$,0U<1E*$Ke(B rescue e$B$7J,$1$J$$$He(B security
issue e$B$Ke(B
e$B$J$j$+$M$J$$=EMW$J$b$N!"$H$+$@$C$?$i%@%a$G$9$,!#e(B

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

In message “[ruby-dev:36371] Re: add “Error” suffix for Encoding
Exceptions”
on Sep.18,2008 19:42:40, [email protected] wrote:

e$B;W$$$D$-$J$s$G$9$,!"e(BEncodingError e$B$H$$$&Nc30$rDj5A$7$F$3$Ne(B 3 e$B$D$re(B
e$B$=$l$i$N%5%V%/%i%9$K$7$?$i$I$&$G$7$g$&$+!#e(B
e$BIaDL$Ke(B rescue e$B$9$k$H$-$Oe(B EncodingError e$B$r;XDj$9$l$P$$$$$@$1$H$9$l$P!“e(B
e$B$=$C$A$NJ}$,3Z$G$9$7!”$3$$$D$i$NL>A0$,D9$/$F$bLdBj$J$$$H;W$$$^$9!#e(B

Encoding::ConverterErrore$B$,$$$$$s$8$c$J$$$G$7$g$&$+!#e(B
3e$B$D$H$be(Btranscode.ce$B$NCf$G$N$_H/@8$9$k$h$&$G$9$7!#e(B

e$B$=$l$G$O!#e(B

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:36378] Re: add “Error” suffix for Encoding
Exceptions”
on Thu, 18 Sep 2008 22:25:40 +0900, “U.Nakamura”
[email protected] writes:

|In message “[ruby-dev:36371] Re: add “Error” suffix for Encoding Exceptions”
| on Sep.18,2008 19:42:40, [email protected] wrote:
|> e$B;W$$$D$-$J$s$G$9$,!"e(BEncodingError e$B$H$$$&Nc30$rDj5A$7$F$3$Ne(B 3 e$B$D$re(B
|> e$B$=$l$i$N%5%V%/%i%9$K$7$?$i$I$&$G$7$g$&$+!#e(B
|> e$BIaDL$Ke(B rescue e$B$9$k$H$-$Oe(B EncodingError e$B$r;XDj$9$l$P$$$$$@$1$H$9$l$P!“e(B
|> e$B$=$C$A$NJ}$,3Z$G$9$7!”$3$$$D$i$NL>A0$,D9$/$F$bLdBj$J$$$H;W$$$^$9!#e(B
|
|Encoding::ConverterErrore$B$,$$$$$s$8$c$J$$$G$7$g$&$+!#e(B
|3e$B$D$H$be(Btranscode.ce$B$NCf$G$N$_H/@8$9$k$h$&$G$9$7!#e(B

Encoding::CompatibilityErrore$B$b$^$H$a$h$&$H;W$C$?$s$G$9$,!#e(B

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:36388] Re: add “Error” suffix for Encoding
Exceptions”
on Fri, 19 Sep 2008 17:12:02 +0900, Martin D.
[email protected] writes:

|transcode e$B<~$j$N8@MU$N?t$,$I$s$I$sA}$($F$$$k$h$&$J5$$,$9$k!#e(B
|e$B85!9$N%a%>%I$Oe(B String#encode e$B$G$9!#$=$l0J30$O0JA0A4Ite(B transcode
|e$B7O$G$7$?$,!“:G6a$Oe(B convert e$B7O$b$”$C$F!"30$+$i8+$k%f!<%6$Oe(B
|e$BAjEv:.Mp$9$k$N$G$O$J$$$+$H;W$o$l$^$9!#@'Hs8@MU$N$b$&$A$g$C$H$Ne(B
|e$BE}0l$r$48!F$4j$$$^$9!#e(B

e$B3N$+$K!#%a%=%C%IL>$Oe(Bencodee$B$G!"<B:]$NJQ49$K4X$9$ke(B(Rubye$B$+$i%f!<%6$K8+e(B
e$B$($kL>A0$Oe(Btranscode/transcoding)e$B$GE}0l$7$?J}$,$h$$$G$7$g$&!#e(B

At 22:25 08/09/18, U.Nakamura wrote:

3e$B$D$H$be(Btranscode.ce$B$NCf$G$N$_H/@8$9$k$h$&$G$9$7!#e(B
[e$B0JA0$=$NJU$j$K5DO@$,$"$C$?$i$4$a$s$J$5$$!#e(B]

transcode e$B<~$j$N8@MU$N?t$,$I$s$I$sA}$($F$$$k$h$&$J5$$,$9$k!#e(B
e$B85!9$N%a%>%I$Oe(B String#encode e$B$G$9!#$=$l0J30$O0JA0A4Ite(B
transcode
e$B7O$G$7$?$,!“:G6a$Oe(B convert e$B7O$b$”$C$F!"30$+$i8+$k%f!<%6$Oe(B
e$BAjEv:.Mp$9$k$N$G$O$J$$$+$H;W$o$l$^$9!#@'Hs8@MU$N$b$&$A$g$C$H$Ne(B
e$BE}0l$r$48!F$4j$$$^$9!#e(B

e$B59$7$/$*4j$$$7$^$9!#e(B Martin.

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

e$B@.@%$G$9!#e(B

Tanaka A. e$B$5$s$O=q$-$^$7$?e(B:

In article [email protected],
Yukihiro M. [email protected] writes:

e$B3N$+$K!#%a%=%C%IL>$Oe(Bencodee$B$G!"<B:]$NJQ49$K4X$9$ke(B(Rubye$B$+$i%f!<%6$K8+e(B
e$B$($kL>A0$Oe(Btranscode/transcoding)e$B$GE}0l$7$?J}$,$h$$$G$7$g$&!#e(B

transcode e$B$H$$$&$N$OI=$K$O=P$F$$$^$;$s$,!"=P$9$s$G$9$+e(B?

transcode e$B$H$$$&$N$Oe(B Ruby 1.9
e$B$NJQ49%(%s%8%s$N$@$HM}2r$7$F$$$^$7$?!#e(B
e$BI=$K=P$9$Y$-L>A0$J$N$+$O<c43$N5?Ld$,$"$j$^$9!#e(B

e$B0UL#E*$K!VJ8;z%3!<%I$NJQ49!W$,e(B Convert e$B$h$je(B Transcode
e$B$NJ}$,E,@Z$G$"$k!“e(B
e$B$H$$$C$?M}M3$J$i$P$”$j$J$N$+$b$7$l$^$;$s$,!#e(B

In article [email protected],
Yukihiro M. [email protected] writes:

e$B3N$+$K!#%a%=%C%IL>$Oe(Bencodee$B$G!"<B:]$NJQ49$K4X$9$ke(B(Rubye$B$+$i%f!<%6$K8+e(B
e$B$($kL>A0$Oe(Btranscode/transcoding)e$B$GE}0l$7$?J}$,$h$$$G$7$g$&!#e(B

transcode e$B$H$$$&$N$OI=$K$O=P$F$$$^$;$s$,!"=P$9$s$G$9$+e(B?

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:36414] Re: add “Error” suffix for Encoding
Exceptions”
on Sat, 20 Sep 2008 18:03:15 +0900, “NARUSE, Yui”
[email protected] writes:

|>> e$B3N$+$K!#%a%=%C%IL>$Oe(Bencodee$B$G!“<B:]$NJQ49$K4X$9$ke(B(Rubye$B$+$i%f!<%6$K8+e(B
|>> e$B$($kL>A0$Oe(Btranscode/transcoding)e$B$GE}0l$7$?J}$,$h$$$G$7$g$&!#e(B
|>
|> transcode e$B$H$$$&$N$OI=$K$O=P$F$$$^$;$s$,!”=P$9$s$G$9$+e(B?
|
|transcode e$B$H$$$&$N$Oe(B Ruby 1.9 e$B$NJQ49%(%s%8%s$N$@$HM}2r$7$F$$$^$7$?!#e(B
|e$BI=$K=P$9$Y$-L>A0$J$N$+$O<c43$N5?Ld$,$"$j$^$9!#e(B

e$B2~$a$F9M$($F$_$^$7$?$,e(B(e$BCY$$e(B)e$B!"8=>ue(Btranscodee$B$H$$$&C18l$Oe(BRuby
e$BB&$K$O8+$($F$J$$$N$G$9$M!#$H$J$k$H9M$($r2~$a$Fe(B

  • e$B%a%=%C%IL>$Oe(Bencode
  • Ce$B%l%Y%k$N%k!<%A%s!&%G!<%?9=B$$Oe(Btranscode
  • e$BJQ49$Oe(Bconvert

e$B$H;H$$J,$1$k$3$H$K$7$^$9!#MW$9$k$K8=>u$N$^$^!#e(B
e$B$U$i$U$i$7$F$9$_$^$;$s!#e(B

In article [email protected],
Yukihiro M. [email protected] writes:

e$B$H;H$$J,$1$k$3$H$K$7$^$9!#MW$9$k$K8=>u$N$^$^!#e(B
e$B$U$i$U$i$7$F$9$_$^$;$s!#e(B

e$B$9$$$^$;$s!#e(B

e$B%?%$%_%s%0$,$J$s$G$9$,!"e(B
rb_str_transcode e$B$re(B
rb_str_encode e$B$K2~L>$9$k$3$H$rDs0F$7$F$b$$$$$G$7$g$&$+!#e(B

e$B8=>u!"e(Bstatic e$B$G$J$$4X?t$G!"e(Btranscode
e$B$H$$$&L>A0$r;H$C$F$$$k$N$Oe(B

% nm -g transcode.o|grep trans
000084a6 T Init_transcode
000001bd T rb_declare_transcoder
00000133 T rb_register_transcoder
00006997 T rb_str_transcode

e$B$H$$$&e(B 4e$B$D$@$1$G!">e$Ne(B
3e$B$D$OJQ49%(%s%8%s$N<BAu$HL)@$K4X78$7e(B
e$B$F$$$k$N$Ge(B transcode e$B$G$$$$$N$G$9$,!“J8;zNs%*%V%8%'%/%H$NJQe(B
e$B49$r9T$&4X?t$Ne(B rb_str_transcode e$B$O!”%(%s%8%s$H$$$&$h$j5!G=$Ne(B
e$BL>A0$G$9!#e(B

Ruby e$B%l%Y%k$N%a%=%C%I$NL>A0$H0lCW$5$;$F!“e(Brb_str_encode e$B$H$9e(B
e$B$k$N$,$o$+$j$d$9$$$H;W$&$s$G$9$,!”$I$&$G$7$g$&$+!#e(B

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:36593] Re: add “Error” suffix for Encoding
Exceptions”
on Fri, 26 Sep 2008 11:31:47 +0900, Tanaka A. [email protected]
writes:

|e$B%?%$%_%s%0$,$J$s$G$9$,!"e(B
|rb_str_transcode e$B$re(B
|rb_str_encode e$B$K2~L>$9$k$3$H$rDs0F$7$F$b$$$$$G$7$g$&$+!#e(B
|
|e$B8=>u!"e(Bstatic e$B$G$J$$4X?t$G!“e(Btranscode e$B$H$$$&L>A0$r;H$C$F$$$k$N$Oe(B
|
|% nm -g transcode.o|grep trans
|000084a6 T Init_transcode
|000001bd T rb_declare_transcoder
|00000133 T rb_register_transcoder
|00006997 T rb_str_transcode
|
|e$B$H$$$&e(B 4e$B$D$@$1$G!”>e$Ne(B 3e$B$D$OJQ49%(%s%8%s$N<BAu$HL)@$K4X78$7e(B
|e$B$F$$$k$N$Ge(B transcode e$B$G$$$$$N$G$9$,!“J8;zNs%*%V%8%'%/%H$NJQe(B
|e$B49$r9T$&4X?t$Ne(B rb_str_transcode e$B$O!”%(%s%8%s$H$$$&$h$j5!G=$Ne(B
|e$BL>A0$G$9!#e(B
|
|Ruby e$B%l%Y%k$N%a%=%C%I$NL>A0$H0lCW$5$;$F!“e(Brb_str_encode e$B$H$9e(B
|e$B$k$N$,$o$+$j$d$9$$$H;W$&$s$G$9$,!”$I$&$G$7$g$&$+!#e(B

e$B;d$O;?@.$G$9!#e(B

Yukihiro M. wrote:

|
|
|Ruby e$B%l%Y%k$N%a%=%C%I$NL>A0$H0lCW$5$;$F!“e(Brb_str_encode e$B$H$9e(B
|e$B$k$N$,$o$+$j$d$9$$$H;W$&$s$G$9$,!”$I$&$G$7$g$&$+!#e(B

e$B;d$O;?@.$G$9!#e(B

e$B!!e(BC API e$B$Ne(B fix
e$B$Oe(B10e$B7nKv$^$G!$$H$$$&OC$@$C$?$h$&$K5-21$7$F$^$9!%$I$&e(B
e$B$G$7$g$&$+!%e(B

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B
e$B$A$g$C$H0zMQ=g$$$8$j$^$9!#e(B

In message “[ruby-dev:36593] Re: add “Error” suffix for Encoding
Exceptions”
on Sep.26,2008 11:31:47, [email protected] wrote:

Ruby e$B%l%Y%k$N%a%=%C%I$NL>A0$H0lCW$5$;$F!“e(Brb_str_encode e$B$H$9e(B
e$B$k$N$,$o$+$j$d$9$$$H;W$&$s$G$9$,!”$I$&$G$7$g$&$+!#e(B

e$B;?@.$7$^$9!#e(B

e$B49$r9T$&4X?t$Ne(B rb_str_transcode e$B$O!"%(%s%8%s$H$$$&$h$j5!G=$Ne(B
e$BL>A0$G$9!#e(B

e$B$9$_$^$;$s!“$D$$$5$C$-e(B1e$B8DA}$d$7$A$c$$$^$7$?e(B…
rb_transcode_convertiblee$B$Oe(Brb_enc_convertiblee$B$”$?$j$G$9$+$M!#e(B

e$B$=$l$G$O!#e(B