Special encoding aliases

e$B$J$+$@$G$9!#e(B

e$B@hF|$N%_!<%F%#%s%0$G!“e(B"locale"e$B$de(B"external"e$B$J$I$NJLL>$rDI2C$9$k$He(B
e$B$$$&OC$,=P$?$h$&$J5$$,$9$k$s$G$9$,!”$I$&$J$j$^$7$?$C$1!#e(B

Index: encoding.c

— encoding.c (revision 19983)
+++ encoding.c (working copy)
@@ -997,9 +997,9 @@ rb_locale_encoding(void)

 if (NIL_P(charmap))
  •    return rb_usascii_encoding();
    
  • else
  •    idx = rb_enc_find_index(StringValueCStr(charmap));
    
  • if (idx < 0)
  •    return rb_ascii8bit_encoding();
    
  •    idx = rb_usascii_encindex();
    
  • else if ((idx = rb_enc_find_index(StringValueCStr(charmap))) < 0)

  •    idx = rb_ascii8bit_encindex();
    
  • if (rb_enc_registered(“locale”) < 0) enc_alias(“locale”, idx);

    return rb_enc_from_index(idx);
    @@ -1058,4 +1058,5 @@ rb_enc_set_default_external(VALUE encodi
    default_external_index = rb_enc_to_index(rb_to_encoding(encoding));
    default_external = 0;

  • enc_alias(“external”, default_external_index);
    }

@@ -1106,5 +1106,6 @@

default_internal_index = rb_utf8_encindex();
default_internal = 0;

  • enc_alias(“internal”, default_internal_index);
    }

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

In message “Re: [ruby-dev:36976] special encoding aliases”
on Tue, 28 Oct 2008 19:02:05 +0900, Nobuyoshi N.
[email protected] writes:

|e$B@hF|$N%_!<%F%#%s%0$G!“e(B"locale"e$B$de(B"external"e$B$J$I$NJLL>$rDI2C$9$k$He(B
|e$B$$$&OC$,=P$?$h$&$J5$$,$9$k$s$G$9$,!”$I$&$J$j$^$7$?$C$1!#e(B

e$B$[$7$$$G$9!#%3%_%C%H$7$F$/$@$5$$!#e(B