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$i$J$$$H$$$&$N$O9s$G$9!%e(B
e$B%G%U%)%k%H$r;H$o$J$$>l9g$K$N$_e(B encoding e$B;XDj$,I,MW$K$J$k$H$$$&$N$,e(B
e$B9%$^$7$$;Q$G$O$J$$$G$7$g$&$+!%e(B

ruby -e’print “e$B$[$2e(B”’ e$B$Ne(B “e$B$[$2e(B” e$B$K$Oe(B
Encoding.default_external e$B$r;XDj$7e(B
e$B$F$h$5$=$&$J5$$,$9$k$N$G$9$,!“I{:nMQ$C$F$”$j$^$9$+$M!)e(B

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

In message “Re: [ruby-dev:33047] Re: Binary String”
on Sat, 12 Jan 2008 01:26:46 +0900, Tanaka A. [email protected]
writes:

|> $ ruby19 -e ‘a = “aaa”; e = “e$B4A;ze(B”; p [a.encoding, e.encoding, Encoding.default_external]’
|> [#Encoding:ASCII-8BIT, #Encoding:ASCII-8BIT, #Encoding:EUC-JP]
|> ------------------------------------------------------------------------
|> e$B$H$$$&$3$H$K$J$j$^$9$,!$$3$l$O8=>u$,4V0c$C$F$$$k$H$$$&$3$H$G$7$g$&$+!)e(B
|
|e$B:G=i$Ne(B a e$B$Oe(B ASCII e$B$7$+4^$^$l$F$$$J$$$N$Ge(B ASCII-8BIT e$B$H$J$C$Fe(B
|e$B$$$F$b!"JQ49$;$:$KAw$C$F$b$J$s$NLdBj$b$J$$$H;W$$$^$9!#e(B

e$BAj<j$,e(BUTF-8e$B$N$h$&$Je(BASCIIe$B$N>e0L8_49$N%(%s%3!<%G%#%s%0$,=hM}BPe(B
e$B>]$G$“$l$P!”$G$9$M!#e(BTke$B$O$=$&$$?$$$@$1$I!#$=$l$,$?$H$($Pe(B
UTF-16e$B$
$?$$$J$N$@$H!"%F%-%9%H$H%P%$%J%j$O$b$C$H87L)$K6hJL$5e(B
e$B$l$J$$$He(Bae$B$N$h$&$J%1!<%9$G:$$k$+$b$7$l$^$;$s$M!#e(B

                            e$B$^$D$b$He(B e$B$f$-$R$me(B /:|)

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

Yukihiro M. wrote:

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

In message “Re: [ruby-dev:33049] Re: Binary String”
on Sat, 12 Jan 2008 02:36:03 +0900, “NARUSE, Yui” [email protected] writes:

|ruby -e’print “e$B$[$2e(B”’ e$B$Ne(B “e$B$[$2e(B” e$B$K$Oe(B Encoding.default_external e$B$r;XDj$7e(B
|e$B$F$h$5$=$&$J5$$,$9$k$N$G$9$,!“I{:nMQ$C$F$”$j$^$9$+$M!)e(B

e$B$=$&$G$9$M!#$“$^$jLdBj$OH/@8$7$J$$$h$&$K;W$$$^$9!#$”$H!"0z?te(B
e$B$J$7$GI8=F~NO$+$i%W%m%0%i%$r<u$1IU$1$k;~$b!#e(B

e$B$3$s$J46$8$G$9$+$M!#e(B
e$B$3$N;~E@$G$Oe(B default_external e$B$G$O$J$/e(B locale encoding
e$B$G$7$?!#e(B

Index: ruby.c

— ruby.c (revision 14996)
+++ ruby.c (working copy)
@@ -984,9 +984,14 @@ process_options(VALUE arg)
if (opt->enc_name != 0) {
opt->enc_index = opt_enc_index(opt->enc_name);
}

  • if (opt->enc_index >= 0) {
  •   enc = rb_enc_from_index(opt->enc_index);
    
  • }
  • else {
  •   enc = rb_locale_encoding();
    
  • }
    if (opt->e_script) {
  •   if (opt->enc_index >= 0)
    
  •       rb_enc_associate_index(opt->e_script, opt->enc_index);
    
  •   rb_enc_associate(opt->e_script, enc);
      require_libraries();
      tree = rb_parser_compile_string(parser, opt->script,
    

opt->e_script, 1);
}
@@ -1021,12 +1026,6 @@ process_options(VALUE arg)
}
}

  • if (opt->enc_index >= 0) {

  •   enc = rb_enc_from_index(opt->enc_index);
    
  • }

  • else {

  •   enc = rb_locale_encoding();
    
  • }
    rb_enc_set_default_external(rb_enc_from_encoding(enc));

    return (VALUE)tree;
    @@ -1153,6 +1152,7 @@ load_file(VALUE parser, const char fnam
    require_libraries(); /
    Why here? unnatural */
    }
    if (opt->enc_index >= 0) rb_enc_associate_index(f, opt->enc_index);

  • else rb_enc_associate(f, rb_locale_encoding());
    tree = (NODE *)rb_parser_compile_file(parser, fname, f,
    line_start);
    if (script && rb_parser_end_seen_p(parser)) {
    rb_define_global_const(“DATA”, f);

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

In message “Re: [ruby-dev:33049] Re: Binary String”
on Sat, 12 Jan 2008 02:36:03 +0900, “NARUSE, Yui”
[email protected] writes:

|ruby -e’print “e$B$[$2e(B”’ e$B$Ne(B “e$B$[$2e(B” e$B$K$Oe(B Encoding.default_external e$B$r;XDj$7e(B
|e$B$F$h$5$=$&$J5$$,$9$k$N$G$9$,!“I{:nMQ$C$F$”$j$^$9$+$M!)e(B

e$B$=$&$G$9$M!#$“$^$jLdBj$OH/@8$7$J$$$h$&$K;W$$$^$9!#$”$H!"0z?te(B
e$B$J$7$GI8=F~NO$+$i%W%m%0%i%$r<u$1IU$1$k;~$b!#e(B

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

In message “Re: [ruby-dev:33052] Re: Binary String”
on Sat, 12 Jan 2008 03:57:28 +0900, “NARUSE, Yui”
[email protected] writes:

|> e$B$=$&$G$9$M!#$“$^$jLdBj$OH/@8$7$J$$$h$&$K;W$$$^$9!#$”$H!"0z?te(B
|> e$B$J$7$GI8=F~NO$+$i%W%m%0%i%$r<u$1IU$1$k;~$b!#e(B
|
|e$B$3$s$J46$8$G$9$+$M!#e(B
|e$B$3$N;~E@$G$Oe(B default_external e$B$G$O$J$/e(B locale encoding e$B$G$7$?!#e(B

e$B%3%%C%H$7$F$$F$/$@$5$$!#$7$P$i$/;H$C$FMM;R$r8+$^$7$g$&!#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:33052] Re: Binary String”
on Jan.12,2008 03:57:28, [email protected] wrote:
| > |ruby -e’print “e$B$[$2e(B”’ e$B$Ne(B “e$B$[$2e(B” e$B$K$Oe(B Encoding.default_external e$B$r;XDj$7e(B
| > |e$B$F$h$5$=$&$J5$$,$9$k$N$G$9$,!“I{:nMQ$C$F$”$j$^$9$+$M!)e(B
| >
| > e$B$=$&$G$9$M!#$“$^$jLdBj$OH/@8$7$J$$$h$&$K;W$$$^$9!#$”$H!"0z?te(B
| > e$B$J$7$GI8=F~NO$+$i%W%m%0%i%$r<u$1IU$1$k;~$b!#e(B
|
| e$B$3$s$J46$8$G$9$+$M!#e(B
| e$B$3$N;~E@$G$Oe(B default_external e$B$G$O$J$/e(B locale encoding e$B$G$7$?!#e(B

-ee$B$$h$SI8=`F~NO$+$i$N%9%/%j%W%H$,e(Blocale
encodinge$B$K$J$k$N$O$$e(B
e$B$$$s$G$9$,!"$3$N%Q%C%Ae(B(e$B$b$&F~$C$F$^$9$,e(B)e$B$G$O!"DL>o$N%9%/%j%We(B
e$B%H$be(Blocale encodinge$B$K$J$C$F$7$^$$$^$9!#e(B
e$B$3$l$O0U?^E
$J$b$N$G$7$g$&$+e(B?

e$B$J$s$H$J$/!"e(Bruby 1.8e$B$+$i$NN`?d$@$H!“e(Bmagic
commente$B$J$7$N%9%/%je(B
e$B%W%H%U%!%$%k$K$D$$$F$O!”$3$N%Q%C%A0JA0$HF1$8$h$&$Ke(Bencodinge$B;Xe(B
e$BDj$J$7$H07$&$Y$-$h$&$K;W$$$^$9!#e(B

Index: ruby.c

— ruby.c (revision 14998)
+++ ruby.c (working copy)
@@ -1152,7 +1152,7 @@ load_file(VALUE parser, const char fnam
require_libraries(); /
Why here? unnatural */
}
if (opt->enc_index >= 0) rb_enc_associate_index(f, opt->enc_index);

  • else rb_enc_associate(f, rb_locale_encoding());
  • else if (f == rb_stdin) rb_enc_associate(f, rb_locale_encoding());
    tree = (NODE *)rb_parser_compile_file(parser, fname, f,
    line_start);
    if (script && rb_parser_end_seen_p(parser)) {
    rb_define_global_const(“DATA”, f);

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:33054] Re: Binary String”
on Sat, 12 Jan 2008 08:03:51 +0900, “U.Nakamura”
[email protected] writes:

|-ee$B$$h$SI8=`F~NO$+$i$N%9%/%j%W%H$,e(Blocale encodinge$B$K$J$k$N$O$$e(B
|e$B$$$s$G$9$,!"$3$N%Q%C%Ae(B(e$B$b$&F~$C$F$^$9$,e(B)e$B$G$O!"DL>o$N%9%/%j%We(B
|e$B%H$be(Blocale encodinge$B$K$J$C$F$7$^$$$^$9!#e(B
|e$B$3$l$O0U?^E
$J$b$N$G$7$g$&$+e(B?

e$B$“$A$c$”!"$=$l$Oe(B(e$B;d$Oe(B)e$B0U?^$7$F$^$;$s$G$7$?!#e(B

|e$B$J$s$H$J$/!"e(Bruby 1.8e$B$+$i$NN`?d$@$H!“e(Bmagic commente$B$J$7$N%9%/%je(B
|e$B%W%H%U%!%$%k$K$D$$$F$O!”$3$N%Q%C%A0JA0$HF1$8$h$&$Ke(Bencodinge$B;Xe(B
|e$BDj$J$7$H07$&$Y$-$h$&$K;W$$$^$9!#e(B

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

e$B1J0f!wCNG=!%6e9)Bg$G$9!%e(B

From: Tanaka A. [email protected]
Subject: [ruby-dev:33047] Re: Binary String
Date: Sat, 12 Jan 2008 01:26:46 +0900
Message-ID: [email protected]

e$B$H$$$&$3$H$K$J$j$^$9$,!$$3$l$O8=>u$,4V0c$C$F$$$k$H$$$&$3$H$G$7$g$&$+!)e(B
e$B$3$3$G1J0f$5$s$NJQ49$NLdBj$Oe(B e e$B$@$H;W$$$^$9$,!"%9%/%j%W%H$re(B
locale e$B0MB8$K$7$?$$$H$$$&$3$H$G$9$+e(B?

e$B%G%U%)%k%H$G$O$=$l$b$“$j$H$$$&5$$O$7$^$9$,!$e(B
e$B$=$&$$$&OC$G$O$”$j$^$;$s!%e(B
e$B!Ve(BASCII-8BIT e$B$,IU$$$F$$$kJ}$,0-$$!W$H$$$&OC$KBP$7!$e(B
e$B!V8=>u$OL$Dj5A$@$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j5A$HDj5A:Q$H$N6hJL$,$J$5$l$F$$$J$$$h$&$K8+$($k8=>u$KBP$7!$e(B
e$B$;$a$F!Ve(B(e$BL$Dj5Ae(Bore$BDj5A:Qe(B)e$B$HDj5A:Q!W$N6hJL$,$G$-$k$h$&$K$7$F$[$7$$e(B
e$B$H$$$&$b$N$G$9!%e(B
e$B$G$9$N$G!$Nc$($PL$Dj5Ae(B == dummy encoding e$B$G$“$j!$e(B
e$B$=$l$K$h$C$F!VL$Dj5A$HDj5A:Q!W$N6hJL$,$G$-$k$N$G$”$l$Pe(B
binary == ASCII-8BIT e$B$G$b2?$iITK~$O$"$j$^$;$s!%e(B

e$B$3$s$K$A$Oe(B sheepman e$B$G$9!#e(B

On Sat, 12 Jan 2008 10:08:23 +0900
Hidetoshi NAGAI [email protected] wrote:

e$B!VL$Dj5A!W$O%G%U%)%k%H$r;29M$K$7$F$G$“$kDxEY$O5_:Q$G$-$^$9$+$i!$e(B
e$B$G$-$k8B$j5_:Q$7$F$”$2$?$$$H;W$C$F$^$9!%e(B

e$BFC$K0U8+$O$J$/$F3NG’$J$s$G$9$,!“%(%s%3!<%G%#%s%0$,!VL$Dj5A!W$NJ8;zNs$,e(B
default_external
e$B$G$”$k$HM=A[$7$F5_:Q$9$k$N$OL5M}$@$H;W$$$^$9!#e(B[ruby-dev:32560]e$B!#e(B

e$B%(%s%3!<%G%#%s%0$,!VL$Dj5A!W$NJ8;zNs$,=PMh$k>l9g$H$$$&$N$Oe(B
[ruby-dev:33040]e$B$G$^$D$b$H$5$s$,$N$Y$i$l$F$$$k$h$&$Ke(B

1 default_externale$B$,e(B ASCII-8BIT e$B$K$J$C$F$7$^$&%1!<%9e(B
2 script encoding e$B$,;XDj$5$l$J$+$C$?;~$Ne(B ASCII-8BIT
3 e$BJ8;zNs$r9=@.$9$k%P%$%H$,$9$Y$Fe(B7bite$B$N;~$Ne(B ASCII-8BIT

e$B$G$9!#$3$l$i$N$I$N%1!<%9$G$bJ8;zNs$N%(%s%3!<%G%#%s%0$,e(B
default_external e$B$G$“$k$H?dB,$9$ke(B
e$B$N$OE,Ev$G$O$”$j$^$;$s!#e(B

e$B5_:Q$9$k$H$7$?$ie(B nkf e$B$+2?$+$G%(%s%3!<%G%#%s%0$re(B guess
e$B$7$?>e$GJQ49$9$k$3$H$K$J$k$H;W$$$^$9!#e(B

At 10:08 08/01/12, Hidetoshi NAGAI wrote:

e$B1J0f!wCNG=!%6e9)Bg$G$9!%e(B

From: Tanaka A. [email protected]
Subject: [ruby-dev:33047] Re: Binary String

e$B$G!$!VL$Dj5A!W$,L@3N$K$G$-$J$$$N$G$"$k$J$i!$e(B
e$B5U$K$;$a$F!VJQ496X;$HDj5A:Q!W$rL@3N$K@k8@$G$-$k$b$N$,e(B
e$BM
$7$$$H$$$&4uK>$G$9!%e(B

e$B$=$&$G$9$M!#$I$&$7$F$b%k%S$=$N$b$N$d54<V$G$O%5%]!<%H$7$F$J$$$,e(B
e$BJQ49$,$G$-$k%(%s%3!<%G%#%s%0Ev$?$j$G$=$&$7$J$$$H>-MhLdBj$K$J$ke(B
e$B5$$,$7$F$J$j$^$;$s!#e(B

e$B$^$::G=i$K!$e(B

  • encoding e$B$,L$Dj5A$J$i$P!$%G%U%)%k%H$r;H$C$F5_:Q$7$F$"$2$?$$$He(B
    e$B9M$($k$N$O!V0-!W$+!)e(B

e$B4pK\E*$K$O$=$&$G$9$M!#<+J,$N$H$3$m$G$O$&$^$/9T$/$,!"e(B
e$BB>$N$H$3$m$O$J$<$+$h$/J,$+$i$J$$$3$H$G$@$a$K$J$k$N$Oe(B
e$BLdBj$G$9$h$M!#e(B

e$B8=>u$O$H$b$“$l!$:#8e$Oe(B encoding e$BL$Dj5A$Ge(B ASCII-8BIT e$B$,e(B
e$B@_Dj$5$l$k$3$H$O0l@Z$J$$$H$$$&$3$H$G$”$l$P!$e(B
ASCII-8BIT e$B$re(B binary e$B$H$7$FMQ$$$k$3$H$K$bLdBj$O$J$/$J$j$^$9!%e(B

e$B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binary e$B$NF3F~$r!W$H$$$&4uK>$O!$e(B
e$BL$Dj5A$HDj5A:Q$H$N6hJL$,$J$5$l$F$$$J$$$h$&$K8+$($k8=>u$KBP$7!$e(B
e$B$;$a$F!Ve(B(e$BL$Dj5Ae(Bore$BDj5A:Qe(B)e$B$HDj5A:Q!W$N6hJL$,$G$-$k$h$&$K$7$F$[$7$$e(B
e$B$H$$$&$b$N$G$9!%e(B
e$B$G$9$N$G!$Nc$($PL$Dj5Ae(B == dummy encoding e$B$G$“$j!$e(B
e$B$=$l$K$h$C$F!VL$Dj5A$HDj5A:Q!W$N6hJL$,$G$-$k$N$G$”$l$Pe(B
binary == ASCII-8BIT e$B$G$b2?$iITK~$O$"$j$^$;$s!%e(B

                                  e$B1J0fe(B e$B=(Mxe(B e$B!J6e9)Bge(B e$BCNG=>pJs!Ke(B
                                      [email protected]

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

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

e$B$J$s$+!"9q:]5,3J$H$+$9$4$$OC$^$G$$$C$A$c$C$F$^$9$,!"e(B
e$B<!$N$h$&$J9M$(J}$O$@$a$G$9$+e(B??

e$B;d$O!"!Ve(BStringe$B!W$H$$$&$N$OI,$:$7$b!VJ8;zNs!W$G$O$J$$e(B
e$B$b$C$H9-$$35G0$N%/%i%9$@$H;W$C$F$$$^$9!#e(B

e$B$G$9$+$i!“EvA3!VJ8;zNs$G$O$J$$e(BStringe$B!W$b$”$k$o$1$Ge(B
e$B$=$N$h$&$J!VJ8;zNs$G$O$J$$e(BStringe$B!W$N!V@5$7$$!We(Bencodinge$B$H$7$Fe(B
e$B!Ve(Bbinarye$B!W$C$F$N$,$"$C$F$b$$$$$s$8$c$J$$$+!#e(B

e$B$H$$$&9M$(J}$O:N$l$J$$$G$7$g$&$+!#e(B

e$B1J0f!wCNG=!%6e9)Bg$G$9!%e(B

From: sheepman [email protected]
Subject: [ruby-dev:33057] strings of UNKNOWN-8BIT (was Re: Binary
String)
Date: Sat, 12 Jan 2008 12:17:35 +0900
Message-ID: [email protected]

e$B%(%s%3!<%G%#%s%0$,!VL$Dj5A!W$NJ8;zNs$,=PMh$k>l9g$H$$$&$N$Oe(B
[ruby-dev:33040]e$B$G$^$D$b$H$5$s$,$N$Y$i$l$F$$$k$h$&$Ke(B

1 default_externale$B$,e(B ASCII-8BIT e$B$K$J$C$F$7$^$&%1!<%9e(B
2 script encoding e$B$,;XDj$5$l$J$+$C$?;~$Ne(B ASCII-8BIT
3 e$BJ8;zNs$r9=@.$9$k%P%$%H$,$9$Y$Fe(B7bite$B$N;~$Ne(B ASCII-8BIT

e$B$G$9!#$3$l$i$N$I$N%1!<%9$G$bJ8;zNs$N%(%s%3!<%G%#%s%0$,e(B default_external e$B$G$“$k$H?dB,$9$ke(B
e$B$N$OE,Ev$G$O$”$j$^$;$s!#e(B

Ruby e$B$Ne(B default_external e$B$,E,Ev$G$O$J$$>u67$G$"$C$F$b!$e(B
Tcl/Tk e$B$,;}$C$F$$$k%7%9%F%`%(%s%3!<%G%#%s%0>pJs$H$$$&e(B
e$B==J,$KM-8z$J>pJs$,B8:_$7$^$9!%e(B
e$B!VL$Dj5A!W$G!$$+$D!$e(BRuby
e$B>e$GE,@Z$J%(%s%3!<%G%#%s%0JQ49$,$G$-$J$$$J$i!$e(B
Tcl/Tk e$BB&$Ne(B encoding e$BJQ49%k!<%A%s$,;H$($^$9!%e(B

At 01:26 08/01/12, Tanaka A. wrote:

In article [email protected],
Hidetoshi NAGAI [email protected] writes:

  1. encoding e$B$O9q$J$I$,@)Dj$9$k5,3J$G$"$k$3$HB?$/!“8D?M$,9%$-e(B
    e$B>!<j$KDj5A$9$k$3$H$O$”$^$j$J$$e(B

e$B$3$l$+$i$NA}2C$K$D$$$F$OA4$/F10U$G$9$,!“2a5n$NOC$@$HA4A30c$$$^$9!#e(B
e$B9q$d9q:]5!4X$J$I$,7h$a$k$b$N$,A4BNE*$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C$F$/$k$H$+e(B
:-)e$B!#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$B1J0f!wCNG=!%6e9)Bg$G$9!%e(B

From: Martin D. [email protected]
Subject: [ruby-dev:33062] Re: Binary String
Date: Sat, 12 Jan 2008 15:03:31 +0900
Message-ID: 6.0.0.20.2.20080112144448.03cbfcb0@localhost

  • e$B6hJL$G$-$k$h$&$K$9$k$J$i!$!VL$Dj5A$HDj5A:Q!W$H$9$k$N$+!$e(B
    e$B$=$l$H$b!Ve(B(e$BL$Dj5Ae(Bore$BDj5A:Qe(B)e$B$HDj5A:Q!W$H$9$k$N$+!)e(B

e$B$3$l$O$A$g$C$H$h$/J,$+$j$^$;$s$G$7$?!#e(B

encoding e$BL>$ONc$G$9$,!$e(B

(1) e$BL$Dj5A$N>l9g$N$!'e(BUNKNOWN-8BIT
e$BDj5A:Q$N>l9g$N$
!'e(BASCII-8BIT

e$B$$$&$h$&$K$9$k$N$+!$e(B

(2) e$BL$Dj5A$HDj5A:Q$NN>J}$N2DG=@-$"$j!'e(BASCII-8BIT
e$BDj5A:Q$N>l9g$N$_!'e(BBINARY

e$B$H$$$&$h$&$K$9$k$N$+$H$$$&$h$&$J0UL#$G$7$?!%e(B

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

Hidetoshi NAGAI wrote:

Ruby e$B$Ne(B default_external e$B$,E,Ev$G$O$J$$>u67$G$"$C$F$b!$e(B
Tcl/Tk e$B$,;}$C$F$$$k%7%9%F%`%(%s%3!<%G%#%s%0>pJs$H$$$&e(B
e$B==J,$KM-8z$J>pJs$,B8:_$7$^$9!%e(B

Ruby e$B$Ne(B default_external e$B$O4pK\E*$Ke(B locale
e$B$+$i>pJs$r<h$C$F$-$F$$$k$N$Ge(B
e$B$9$,!"!Ve(BTcl/Tk
e$B$,;}$C$F$$$k%7%9%F%%(%s%3!<%G%#%s%0>pJs!W$O$I$3$+$i%7%9e(B e$B%F%%(%s%3!<%G%#%s%0$rF~<j$7$F$$$k$N$G$9$+!)%Q%C$HD4$Y$?8B$j$G$O$3$A$i$be(B
locale e$B$J$h$&$K8+$($?$N$G$9$,!#e(B

e$B1J0f!wCNG=!%6e9)Bg$G$9!%e(B

From: “NARUSE, Yui” [email protected]
Subject: [ruby-dev:33073] Re: strings of UNKNOWN-8BIT
Date: Sun, 13 Jan 2008 03:14:32 +0900
Message-ID: [email protected]

Ruby e$B$Ne(B default_external e$B$O4pK\E*$Ke(B locale e$B$+$i>pJs$r<h$C$F$-$F$$$k$N$Ge(B
e$B$9$,!"!Ve(BTcl/Tk e$B$,;}$C$F$$$k%7%9%F%%(%s%3!<%G%#%s%0>pJs!W$O$I$3$+$i%7%9e(B e$B%F%%(%s%3!<%G%#%s%0$rF~<j$7$F$$$k$N$G$9$+!)%Q%C$HD4$Y$?8B$j$G$O$3$A$i$be(B
locale e$B$J$h$&$K8+$($?$N$G$9$,!#e(B

e$B4pK\E*$K$Oe(B locale e$B$G$9$,!$e(Blocale
e$B$G$N3MF@$K$O<:GT$7$F$be(B
Tcl/Tk e$B$,CN$C$F$$$kL>A0$G$"$l$P$=$l$,;H$o$l$^$9!%e(B

e$BNc$($Pe(B Linux e$B>e$Ge(B LANG=macJapan tclsh e$B$H$+!%e(B

e$B$=$N>u67$G$OEvA3e(B Ruby e$B$G$Ne(B encoding
e$BJQ49$O;H$($^$;$s$,!$e(B
Tcl/Tk e$B$G$NJQ49$O;H$($^$9!%e(B

e$B$b$A$m$s!$$=$&$7$?e(B string e$B$r$=$N$^$^e(B Ruby
e$B>e$GJ8;zNs=hM}$r$9$k$He(B
e$BITE,@Z$J=hM}$K$J$k2DG=@-$,9b$$$o$1$G$9$,!$e(B
Tk e$B$Ne(B GUI e$B>e$G$NJ8;z2=$1$O2sHr$9$k$3$H$,2DG=$G$9!%e(B

e$B!V$=$&$7$?e(B encoding e$BL>$^$G$9$Y$Fe(B Ruby
e$B$G%5%]!<%H$7$^$9!W$J$ie(B
e$BLdBj$O$J$$$N$G$7$g$&$1$l$I!$$=$s$J@k8@$r$9$k$N$OB?J,L5Cc$G$9$h$M!)e(B
e$B$“$k$$$O!$e(BRuby e$B$NBP1~e(B encoding e$B=89g$,e(B Tcl/Tk
e$B$NBP1~e(B encoding e$B=89g$Ne(B
e$B40A4$Je(B super set e$B$K$J$C$F$$$k$N$G$”$l$P!$e(B
table e$B$rMQ0U$9$k$@$1$G$$$$$N$+$b$7$l$^$;$s!%e(B
e$B$G$9$,$=$&$$$&BP1~$r$9$k$K$7$F$b!$e(BTcl/Tk e$B$O$H$b$+$/!$e(B
e$B$"$i$f$k%1!<%9$Ge(B super set e$B$r0];}$G$-$k$H$Oe(B
(e$BB?J,e(B) e$BJ]>Z$G$-$^$;$s$h$M!)e(B

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

Hidetoshi NAGAI wrote:

e$B4pK\E*$K$Oe(B locale e$B$G$9$,!$e(Blocale e$B$G$N3MF@$K$O<:GT$7$F$be(B
Tcl/Tk e$B$,CN$C$F$$$kL>A0$G$"$l$P$=$l$,;H$o$l$^$9!%e(B

e$B$3$3$G$N!V$=$l!W$Oe(B Encoding.locale_charmap
e$B$HF1$8$b$N$H$$$&M}2r$G@5$7$$e(B
e$B$N$G$7$g$&$+!#e(B

e$BLdBj$O$J$$$N$G$7$g$&$1$l$I!$$=$s$J@k8@$r$9$k$N$OB?J,L5Cc$G$9$h$M!)e(B
e$B$"$k$$$O!$e(BRuby e$B$NBP1~e(B encoding e$B=89g$,e(B Tcl/Tk e$B$NBP1~e(B encoding e$B=89g$Ne(B
e$B40A4$Je(B super set e$B$K$J$C$F$$$k$N$G$"$l$P!$e(B
table e$B$rMQ0U$9$k$@$1$G$$$$$N$+$b$7$l$^$;$s!%e(B
e$B$G$9$,$=$&$$$&BP1~$r$9$k$K$7$F$b!$e(BTcl/Tk e$B$O$H$b$+$/!$e(B
e$B$"$i$f$k%1!<%9$Ge(B super set e$B$r0];}$G$-$k$H$Oe(B
(e$BB?J,e(B) e$BJ]>Z$G$-$^$;$s$h$M!)e(B

e$B>e$,@5$7$$$H2>Dj$7$?>l9g!“e(BEncoding.locale_charmap e$B$NL>A0$Ge(B
dummy
encoding e$B$rEPO?$9$k$H$$$&J}K!$,$”$j$^$9!#e(B

In article 6.0.0.20.2.20080112161852.075f91c0@localhost,
Martin D. [email protected] writes:

e$B$3$l$+$i$NA}2C$K$D$$$F$OA4$/F10U$G$9$,!“2a5n$NOC$@$HA4A30c$$$^$9!#e(B
e$B9q$d9q:]5!4X$J$I$,7h$a$k$b$N$,A4BNE*$K<B$O>/$J$/!”$=$l$KHf$Y$k$He(B
e$B4k6H$NJ}$,B?$/$F!“8D?ME*$J$b$N$b7k9=$”$j$^$9!#J8;zBN7O$K$h$C$Fe(B
e$BId9f2=$NCJ3,$,7k9=$:$l$F$$$k!#F|K$Oe(B1970e$BG/Be$+$i$b$&4{$Ke(B
e$B8=:_$Ne(B JIS 208 e$B$HAjEv6a$$$b$N$,$“$j$^$7$?$,!“e(B1990e$BG/Be$G$be(B
e$B$^$@!VFb$NJ8;zBN7O$K$Oe(B 20 e$B<oN`$NId9f2=$0$i$$$,$”$C$F!“Ds0F<Te(B
e$B$,3’<+J,$N0F$,0lHV$H;W$C$F$$$k!W$H$NOC$b$”$j$^$7$?!#e(B
e$B$=$NCf$NB?$/$O9,$$$J$,$i$7$s$G$7$^$$$^$7$?$,!”;D$k$b$N$b$"$j$^$9!#e(B

e$B$=$&$$$($P$?$7$+$K4k6H$OB?$$$G$9$M!#e(Bsjis e$B$H$+!#e(B

e$B8D?M$,!"$H$$$&$N$OCN$i$J$+$C$?$s$G$9$,!“6qBNE*$K$O$I$s$J$b$Ne(B
e$B$,$”$k$s$G$9$+e(B?

In article [email protected],
Hidetoshi NAGAI [email protected] writes:

e$B<+J,<+?H$G$b2?$,2?$@$+J,$+$i$J$/$J$C$F$-$?$N$G!$e(B
e$B<ALd$r0lC6@0M}$7$F$_$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z!$Bg$-$J$*@$OC!W$G$”$k$H$$$&$N$G$“$l$P!$e(B
e$B$I$&$7$h$&$b$”$j$^$;$s!%e(B

e$B303&$H$N>pJs$N$d$j$H$j$NBgItJ,$KJ8;z$N>pJs$,$D$$$F$$$k$h$&$Ke(B
e$B$J$i$J$$8B$j!“5_:Q<+BN$OI,MW$G$7$g$&!#$7$+$7!”$=$N5_:Q$OE,@Ze(B
e$B$J5_:Q$,$G$-$=$&$J$H$3$m$G9T$&$Y$-$G$9!#$=$7$F!“$=$l$,$G$-$=e(B
e$B$&$J$H$3$m$O!”%G!<%?$,FI$_9~$^$l$k$H$3$m$G$"$j!"e(Btk e$B$K%G!<%?e(B
e$B$rAw$j9~$`$H$3$m$O0c$&$N$G$O$J$$$+$H;W$$$^$9!#e(B

e$B$5$F!"e(Btcl 8.5.0 e$B$Ne(B library/encoding/
e$B$r$$$/$i$+D/$a$F$_$^$7e(B
e$B$?!#4V0c$C$F$$$?$i;XE&$7$F$/$@$5$$!#e(B

ASCII e$B8_49$GC10l%P%$%H$J%(%s%3!<%G%#%s%0$Oe(B ASCII-8BIT e$B$Ne(B
replica e$B$H$7$FDj5A$9$l$P$=$l$J$j$KF0$-$^$9!#e(B
e$B$3$NHOaF$K$“$k$N$Oe(B (Ruby e$B$de(B Oniguruma
e$B$KDj5A$,$”$k$b$N$b4^$ae(B
e$B$Fe(B) e$B0J2<$NDL$j$G$9!#e(B
ascii, cp437, cp737, cp775, cp850, cp852, cp855, cp857,
cp860, cp861, cp862, cp863, cp864, cp865, cp866, cp869,
cp874, cp1250, cp1251, cp1252, cp1253, cp1254, cp1255,
cp1256, cp1257, cp1258, gb1988, iso8859-1, iso8859-2,
iso8859-3, iso8859-4, iso8859-5, iso8859-6, iso8859-7,
iso8859-8, iso8859-9, iso8859-10, iso8859-13, iso8859-14,
iso8859-15, iso8859-16, jis0201, koi8-r, koi8-u,
macCentEuro, macCroatian, macCyrillic, macGreek, macIceland,
macJapan, macRoman, macRomania, macThai, macTurkish,
macUkraine, tis-620

ASCII e$B8_49$J%^%k%A%P%$%H%(%s%3!<%G%#%s%0$O0J2<$NDL$j$G$9!#e(B
e$B$3$NCf$G!"e(Bcp936 (GBK) e$B$He(B cp949 (EUC-KR e$B$Ne(B MS
e$B3HD%e(B) e$B$Oe(B
Oniguruma e$B$K$b$J$/$F!"Dj5A$,I,MW$=$&$G$9!#e(B
cp932, cp936, cp949, cp950, euc-cn, euc-jp, euc-kr, big5,
gb2312, shiftjis

e$B%^%k%A%P%$%H$JJ8;z%;%C%H$r$=$N$^$^07$&!"e(BASCII e$B8_49$G$J$$$N$Oe(B
e$B0J2<$NDL$j$G$9!#e(B
gb12345, gb2312-raw, jis0208, jis0212, ksc5601

ASCII e$B8_49$G$J$$C10l%P%$%H$J%(%s%3!<%G%#%s%0$O0J2<$NDL$j$G$9!#e(B
ebcdic, dingbats, macDingbats, symbol

stateful e$B$J%(%s%3!<%G%#%s%0$O0J2<$NDL$j$G$9!#e(B
iso2022-jp, iso2022-kr, iso2022

e$B$3$&$d$C$FJ,N`$7$F$_$k$H!"e(Blocale e$B$N%(%s%3!<%G%#%s%0$K$J$j$=e(B
e$B$&$J$N$Oe(B ASCII e$B8_49$J$b$N$He(B ebcdic e$B$@$1$K8+$($^$9!#e(B

e$B%^%k%A%P%$%H$JJ8;z%;%C%H$=$N$^$^$N$b$Ne(B (jis0208 e$B$H$+e(B)
e$B$Oe(B
portable character set e$B$,e(B 1e$B%P%$%H$GI=8=$G$-$J$$$H$$$1$J$$$He(B
e$B$$$&e(B POSIX e$B$N5,Ls$KH?$7$^$9!#e(B

dingbats e$B$J$I$N5-9fN`$Oe(B portable character set
e$B$rI=8=$G$-$:!"e(B
e$B$3$l$be(B POSIX e$B$KH?$7$^$9!#e(B

stateful e$B$J$N$Oe(B POSIX e$BE*$K$O$$$A$*$&5v$5$l$F$$$k$h$&$J5$$,$9e(B
e$B$k$N$G$9$,!“<BAu$O$”$j$^$7$?$C$1e(B? e$B$^$!!">/$J$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