Binary String

At 00:42 08/01/14, Tanaka A. wrote:

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?

e$B6qBNE*$KJ,$+$C$F$$$k$b$N$G$O$“$j$^$;$s$,!“Nc$($P%0%k%8%”$H$+e(B
e$B%(%8%W%H$N?M$+$i$=$&$$$&OC$rJ9$-$^$7$?!#F|K\8l$J$I$N>l9g$K$Oe(B
e$B?t$NJI$,$”$j$^$9$,!“?t$,>/$J$$J8;zBN7O$G$ONc$($PBg3X$N@h@8e(B
e$B$H$+<j7Z$K$FDs0F$G$-$k$7!”!V%G!<%?8r49$,0lHVBg;v$J$N$G>/!9e(B
e$BBE6($7$F$b6&DL$NJ*$,$$$$!W$H$$$&G’<1$,Gv$+$C$?e(B (e$B$H$$$&$h$j!“e(B
e$BL5$+$C$?e(B) e$B<!Be$K!”=hM}$NAa$5$G$3$l$,$$$$$H$+%a%b%j$NNL$G$=$le(B
e$B$,$$$$$H$+5$$rD%$C$F5DO@$9$k$N$O:#$+$i8+$l$PJ,$+$j$K$/$$$,!"e(B
e$BEv;~$O7k9=IaDL$@$C$?$H;W$$$^$9!#e(B

e$B4Z9q$G$b?tB?$/$N?M$,%O%s%0%k$KBP$7$F$=$l$>$l7k9=0c$C$F$$$ke(B
e$B;kE@$r;}$D?M8eB?$$$G$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$B1J0f!wCNG=!%6e9)Bg$G$9!%e(B

From: “NARUSE, Yui” [email protected]
Subject: [ruby-dev:33075] Re: strings of UNKNOWN-8BIT
Date: Sun, 13 Jan 2008 10:11:54 +0900
Message-ID: [email protected]

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$B$4$a$s$J$5$$!%;d$K$O$o$+$j$^$;$s!%e(B
e$B$G$9$,!$@.@%$5$s$,$=$&$*$C$7$c$k$N$G$"$l$P!$e(B
e$B$-$C$H$=$&$J$N$G$7$g$&$M!%e(B

encoding e$B$N$3$H$r==J,$KM}2r$G$-$F$$$J$$$^$^$Ke(B

e$B$3$s$J5DO@$r$d$C$F$$$k$3$H$K<+8J7y0-$r46$8$D$D!%!%!%e(B

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

From: Tanaka A. [email protected]
Subject: [ruby-dev:33080] Re: Binary String
Date: Mon, 14 Jan 2008 00:33:41 +0900
Message-ID: [email protected]

e$B$=$&$$$&$H$-$O$d$O$j6qBNE*$JLdBj$KN)$A5"$k$N$,$$$$$s$8$c$J$$e(B
e$B$G$7$g$&$+!#LdBj$N6qBNNc$r<($7$F$_$k$N$O$I$&$G$7$g$&e(B?

e$B0J2<$O!V?dB,!W$H$OJL$NOC$J$N$Ge(B
e$B0lNc$K$J$k$N$+$h$/J,$+$i$J$$E@$b$"$j$^$9$,!$e(B
tk e$B$G@8@.$9$ke(B binary (identity) e$BJ8;zNs$Oe(B
e$B$I$&$d$C$F<1JL2DG=$K$7$F$*$1$P$$$$$N$G$7$g$&$+!)e(B

e$B@8@.$5$l$?J8;zNs$K$Oe(B Ruby
e$B$N%*%V%8%'%/%H$KJQ49$9$k$?$a$N=hM}$re(B
e$BE,MQ$7$?>e$Ge(B Ru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e$B9T$&$N$OHr$1$?$[$&$,$$$$$N$G$O$J$$$G$7$g$&$+!#e(B
Tk e$B$,G’<1e(B or e$BJ];}$7$F$$$k%G%U%)%k%H$Ne(B encoding e$B$Oe(B
e$B$=$N%f!<%6$Ne(B GUI e$B4D6-$K$$$$FIaDL$Ne(B encoding e$B$G$"$j!$e(B
e$BDL>o$O$=$Ne(B encoding e$B$r;H$C$F$$$k$H$$$&$h$&$K?dB,$9$k$N$Oe(B
e$B$5$[$I$
$+$7$J;v$H$O;W$($^$;$s!%e(B
Ruby e$B$Ne(B default_external e$B$,L$Dj5A$N>uBV$K$"$k>l9g$K$N$_e(B
(e$B<1JL$G$-$k$J$i!VL$Dj5A!W$NJ8;zNs$KBP$7$F$N$_e(B)
Tk e$B$N%G%U%)%k%H$r;2>H$7$h$&$H$$$&$3$H$G$9$N$G!$e(B
e$BLdBj$O$J$$$H9M$($^$9!%e(B

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

e$B$J$<e(B binary e$B$G$"$k$3$H$r<($9e(B identity
e$B$,30$5$l$F$$$k$N$G$7$g$&$+!)e(B
generic/tclEncoding.c e$B$Ge(B initial encoding
e$B$NI.F,$GDj5A$5$l$F$$$^$9!%e(B

e$BFq$7$$5_:Q$KD)@o$9$k$h$j$O!"Dj5A$7$A$c$C$?$[$&$,!“e(Btk e$B0J30$Ge(B
e$B$b9,$;$K$J$l$^$9$7!”$$$$$N$G$O$J$$$+$H;W$$$^$9!#e(B

e$B$O$$!%e(B
e$BB>$Ne(B encoding e$B$Ne(B alias e$B$G$O$J$$7A$G$Ne(B identity
e$B$b4^$a$Fe(B
e$BDj5A$7$F$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9$k$N$Oe(B
e$B$5$[$I$
$+$7$J;v$H$O;W$($^$;$s!%e(B
Ruby e$B$Ne(B default_external e$B$,L$Dj5A$N>uBV$K$"$k>l9g$K$N$_e(B
(e$B<1JL$G$-$k$J$i!VL$Dj5A!W$NJ8;zNs$KBP$7$F$N$_e(B)
Tk e$B$N%G%U%)%k%H$r;2>H$7$h$&$H$$$&$3$H$G$9$N$G!$e(B
e$BLdBj$O$J$$$H9M$($^$9!%e(B

  • e$B:G6a$Oe(B locale e$B$K4X$o$i$:FbIte(B Unicode e$B$J$N$G$Oe(B
  • locale_charmap e$B$,$H$l$J$$>l9g$Oe(B US-ASCII e$B$K$J$C$?e(B
    [ruby-dev:33078]
  • ASCII-8BIT e$B$,JV$C$F$/$k>l9g$O!"e(BRuby e$B$NCN$i$J$$e(B encoding
    e$B$N$_e(B
  • Tcl/Tk e$B$,CN$C$F$$$Fe(B Ruby e$B$,CN$i$J$$$N$Oe(B KOI8-U e$B$N$_e(B

KOI8-Ue$B$Oe(BKOI8e$B$He(BKOI8-Re$B$I$A$i$Ne(Breplicae$B$K$9$l$P$o$+$i$J$+$C$?$N$GJ]N1$7$F$$e(B
e$B$^$7$?$,!"e(BWikipediae$B$K$I$C$A$H$b0c$&$H:$C$F$$$?$N$GE,Ev$K$$$8$C$F$=$N$&e(B
e$B$ABP1~$5$;$^$9!#e(B

e$B$J$<e(B binary e$B$G$"$k$3$H$r<($9e(B identity e$B$,30$5$l$F$$$k$N$G$7$g$&$+!)e(B
generic/tclEncoding.c e$B$Ge(B initial encoding e$B$NI.F,$GDj5A$5$l$F$$$^$9!%e(B

default_external e$B$NJ8L.$G$9$+$i!"J8;zNs$KBP$9$ke(B encoding
e$B$N$3$H$G$7$g$&!#e(B

e$BFq$7$$5_:Q$KD)@o$9$k$h$j$O!"Dj5A$7$A$c$C$?$[$&$,!“e(Btk e$B0J30$Ge(B
e$B$b9,$;$K$J$l$^$9$7!”$$$$$N$G$O$J$$$+$H;W$$$^$9!#e(B

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_Dj$7$h$&!”$H$J$k$o$1$G$9!#%F%-%9%H%G!<%?$J$N$Ke(B
ASCII-8BIT
e$B$N$^$^$K$J$C$F$$$kJ}$,$*$+$7$$$s$G$9$h!#$=$3$+$iL$r$=$`$1$Fe(B
ASCII-8BIT
e$B$,:.FY$H$7$F$$$k$^$^$J8B$j!"0lIt$N%P%$%J%j%G!<%?$re(B BINARY
e$B$G3VN%$7$F$bLde(B
e$BBj$N2r7h$K$O$J$j$^$;$s!#e(B

e$B$G!"<B:]$N$H$3$m!"%F%-%9%H%G!<%?$Ke(B encoding
e$B$r$-$A$s$H@Dj$9$l$P!"e(BASCII-
8BIT e$B$Je(B string
e$B$O%P%$%J%j%G!<%?$H$7$F$
$J$7$F$7$^$&$N$GLdBj$J$$$N$G$O$Je(B
e$B$$$+!#2?$+%@%a$JNc$"$k!)$H$$$&$N$,$3$l$+$i$NOC$G$7$g$&$+!#e(B

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

From: “NARUSE, Yui” [email protected]
Subject: [ruby-dev:33108] Re: Binary String
Date: Tue, 15 Jan 2008 09:08:04 +0900
Message-ID: [email protected]

e$B$3$NJQ49=hM}$NH=Dj$r$9$Y$F$N%1!<%9$K$D$$$F5-=R$7$h$&$H$9$k$H!$e(B
e$B%3!<%I$NNL$,6KEY$KA}$($F$7$^$&4m81@-$,Bg$-$/!$e(B
e$B?7$7$$e(B Tcl/Tk e$B$N5!G=e(B/e$BB0@-$KBP$7$F$b$=$NEY$KBP1~:n6H$,e(B
e$BI,MW$K$J$k2DG=@-$b9b$^$k$?$a!$Hr$1$kI,MW$,$"$j$^$9!%e(B

e$B%=!<%9$r$6$C$H8+$?$@$1$J$N$G4V0c$C$F$$$k$+$b$7$l$^$;$s$,!"K\Ev$K$=$&$G$9e(B
e$B$+!#e(Btk_call_without_enc e$B$H$+$Ne(B binary e$BHG$r:n$l$P2r7h$7$?$j$7$^$;$s$+$M!#e(B

e$B%@%a$@$H;W$$$^$9!%e(B

e$B%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JL$G$-$k$h$&$Je(B
binary encoding e$B$,B8:_$7$5$($9$l$P8_49@-0];}$,$G$-$k$H;W$C$F$^$9!%e(B
e$B$=$N$?$a$KF3F~$r$4j$$$7$F$-$?$o$1$G$9$,!$e(B
e$B$I$&$7$F$be(B binary encoding
e$B$r2C$($k$D$b$j$O$J$$$H$$$&$3$H$G$"$l$P!$e(B
e$BHs>o$K;DG0$G$9$,>e5-$Ne(B (2) e$B$rA
Br$9$k$3$H$K$7$^$9!%e(B

e$B$5$9$,$Ke(B (1) e$B$O>-Mh$KBg$-$J2R:,$r;D$7$=$&$G$9$N$G!%e(B

e$B$H$$$&$o$1$G!$K\Ev$K:G8e$N<ALd$G$9!%e(B
binary encoding e$BF3F~!$$^$?$Oe(B ASCII-8BIT e$B$He(B UNKNOWN-8BIT
e$B$N6hJL$Oe(B
e$B$I$&$7$F$b%@%a$G$9$+!)e(B

At 09:50 08/01/15, e$BM73Z0Ce(B wrote:

e$B>x$7JV$7$F$9$_$^$;$s$1$I!"$=$&$$$&!VJ8;zNs$G$J$$e(BStringe$B!W$N$?$a$Ne(B
e$B!V@5$7$$!We(Bencodinge$B$H$7$F$N!Ve(Bbinarye$B!We(B(e$B$G$b!Ve(Bidentitye$B!W$G$b$$$$$G$9$1$Ie(B)e$B$re(B
e$BMQ0U$9$k$3$H$O9M$($i$l$J$$$G$7$g$&$+!#e(B

e$B$=$&$G$9$h$M!#e(B

e$BNc$($Pe(B:

r = ‘’

100.times do
r << (rand 256).chr
end

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]

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

e$B0J2<$O!V?dB,!W$H$OJL$NOC$J$N$Ge(B
e$B0lNc$K$J$k$N$+$h$/J,$+$i$J$$E@$b$"$j$^$9$,!$e(B

e$B6qBNE*$JLdBj$NNc$O$"$j$^$;$s$+e(B?

e$B$?$H$($P!"!Ve(BLANG=xxx e$B$Ge(B ruby -e ‘yyy’ e$B$H$9$k$He(B foo
e$B$K$J$k$Ne(B
e$B$@$1$l$I$b$=$3$Oe(B bar
e$B$K$J$C$F$b$i$o$J$$$H:$$k!W$H$$$&$h$&$J!#e(B

Tk e$B$,G’<1e(B or e$BJ];}$7$F$$$k%G%U%)%k%H$Ne(B encoding e$B$Oe(B
e$B$=$N%f!<%6$Ne(B GUI e$B4D6-$K$$$$FIaDL$Ne(B encoding e$B$G$"$j!$e(B
e$BDL>o$O$=$Ne(B encoding e$B$r;H$C$F$$$k$H$$$&$h$&$K?dB,$9$k$N$Oe(B
e$B$5$[$I$
$+$7$J;v$H$O;W$($^$;$s!%e(B
Ruby e$B$Ne(B default_external e$B$,L$Dj5A$N>uBV$K$"$k>l9g$K$N$_e(B
(e$B<1JL$G$-$k$J$i!VL$Dj5A!W$NJ8;zNs$KBP$7$F$N$_e(B)
Tk e$B$N%G%U%)%k%H$r;2>H$7$h$&$H$$$&$3$H$G$9$N$G!$e(B
e$BLdBj$O$J$$$H9M$($^$9!%e(B

e$B;d$,=R$Y$?e(B MIME e$B$NNc$K$D$$$F$O$I$&$G$9$+e(B?

e$B$J$<e(B binary e$B$G$"$k$3$H$r<($9e(B identity e$B$,30$5$l$F$$$k$N$G$7$g$&$+!)e(B
generic/tclEncoding.c e$B$Ge(B initial encoding e$B$NI.F,$GDj5A$5$l$F$$$^$9!%e(B

e$B$*$)!"$=$s$J$H$3$m$K!#e(B

e$B;d$,$“$2$?Cf$K$J$$$N$O;d$,D/$a$?$N$,e(B tcl 8.5.0 e$B$Ne(B
library/encoding/ e$B$@$+$i$G$9!#e(Blibrary/encoding/ e$B$Ke(B identity
e$B$O$”$j$^$;$s$h$M!#e(B

e$BB>$Ne(B encoding e$B$Ne(B alias e$B$G$O$J$$7A$G$Ne(B identity e$B$b4^$a$Fe(B
e$BDj5A$7$F$$$?$@$1$k$J$i!$9,$;$K$J$l$^$9!%e(B(^_^)
Tk e$B>e$G!Ve(Bbinary e$B$G$“$k!W$H5,Dj$5$l$F$$$ke(B identity e$B$r!$e(B
Ruby e$B>e$G!Ve(Bbinary e$B$G$”$k$H$O8B$i$J$$!W$H$5$l$F$$$ke(B
ASCII-8BIT e$B$Ne(B alias e$B$H$7$FDj5A$5$l$F$7$^$&$N$O:$$j$^$9!%e(B

e$B8!:w$7$F$_$?$H$3$me(B encoding system e$B$Ke(B

| schlenk 2005-06-27: The identity encoding is for testing
| purposes, it should not be used without very good reasons.

e$B$H$$$&5-=R$,$"$j$^$9!#$3$N5-=R$,$I$NDxEY?.MQ$G$-$k$N$+$O$o$+e(B
e$B$i$J$$$N$G$9$,!“e(Bidentity e$B$,e(B binary
e$B$G$”$k$H$$$&5,Dj$b8+$D$1e(B
e$B$i$l$^$;$s$G$7$?!#e(Btcl 8.5.0 e$B$He(B tk 8.5.0 e$B$Ne(B doc/
e$B$OC5$7$?$N$Ge(B
e$B$9$,!"e(Bidentity e$B$K4X$9$k5-=R$O$[$H$s$I8+Ev$?$i$:!"e(Bbinary
e$B$G$"e(B
e$B$k$H$$$&5-:$O$J$$$h$&$K;W$$$^$9!#e(B

identity e$B$,e(B binary e$B$H5,Dj$5$l$F$$$k$H$$$&$N$O$I$3$K=q$$$F$"e(B
e$B$k$N$G$7$g$&e(B?

e$B$(!A$C$H!$e(BASCII-8BIT e$B0J30$O!VL$Dj5A!W$G$O$J$$$N$G$9$h$M!)e(B
e$B%9%/%j%W%H$Ne(B encoding e$B$OL@<($9$k$h$&$K$9$k$N$,4pK$G!$e(B
e$BL@<($,$J$1$l$Pe(B default_external e$B$H$9$ke(B (e$B$3$l$OL$7hDj!)e(B) e$B$N$G$9$h$M!)e(B
e$B$G!$e(Bdefault_external e$B$Oe(B encoding e$B$,7hDj$G$-$J$$>l9g$N$_$Ke(B
ASCII-8BIT e$B$K@Dj$5$l!$$=$N>l9g$Ke(B encoding e$B$r;XDj$;$:$K@8@.$7$?e(B
e$BJ8;z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N2r7h$O$G$-$J$$$H9M$($F$$$^$9!#e(B

e$BEDCf$5$s$b6D$i$l$F$$$^$9$,!"!V6qBNE*$JLdBj$NNc!W8@$$49$($l$P%F%9%H%1!<%9e(B
e$B$,$"$k$HM}2r$7$d$9$$$h$&$K;W$$$^$9!#$"$k<o$N6K8B>uBV!=!=%f!<%6$+$i$be(BTcl/Tk
e$B<+BN$+$i$b%G!<%?$r<u$1<h$j!"$=$N%G!<%?$O%P%$%J%j%G!<%?$N$3$H$b%F%-%9%He(B
e$B%G!<%?$N$3$H$b$"$k$H$$$&%a%=%C%I$,B8:$7!"$5$i$K<u$1<h$k%F%-%9%H%G!<%?$,e(B
ASCII-8BIT
e$B$N$^$^$G$"$k@5Ev$JM}M3$,$"$k%1!<%9!=!=$,$b$7B8:
$9$k$J$i$Pe(B
BINARY
e$B$,I,MW$J2DG=@-$,$"$j$^$9$,!"$o$?$7$O$=$&$$$&%1!<%9$O<B:]$K$OB8:_e(B
e$B$7$J$$$H9M$($F$$$^$9!#H?>Z$,$"$l$P9M$($r2~$a$5$;$F$$$?$@$-$^$9!#e(B

e$B$H$j$"$($:!"e(B

  • locale e$BHsBP1~"*e(BRuby e$B$,BP1~$9$l$P$$$$$@$1e(B
  • magic comment e$B$,$J$$"*$D$1$F$/$@$5$$e(B
    e$B$J$N$G!"$3$l0J30$G$9$+$M!#e(B

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

From: “NARUSE, Yui” [email protected]
Subject: [ruby-dev:33123] Re: Binary String
Date: Tue, 15 Jan 2008 21:09:23 +0900
Message-ID: [email protected]

e$B$"$!!“e(Btk_call_without_enc e$B$OJQ49$7$J$$$s$G$9$M!#$=$l$G$O!”%P%$%J%j%G!<%?e(B
e$B$rMW5a$9$k%a%=%C%I$G$Oe(B tk_call_without_enc e$B$r;H$($P0U?^$7$J$$JQ49$O9T$oe(B
e$B$l$J$$$s$8$c$J$$$G$9$+!)e(B

e$B$=$l$r8F$VA0CJ3,$GJQ49$,I,M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k%1!<%9!=!=$,$b$7B8:_$9$k$J$i$Pe(B

e$B$3$l$K$D$$$F$O$h$/$o$+$j$^$;$s!%e(B
e$BEDCf$5$s$,$*$C$7$c$C$F$$$ke(B MIME e$B$N%1!<%9$N$h$&$K!$e(B
e$BCN$i$J$$$b$N$KBP$7$Fe(B dummy encoding e$B$rDj5A$;$:$Ke(B
ASCII-8BIT e$B$r;H$&$H$$$&%1!<%9$,$I$NDxEYA[Dj$5$l$k$Y$-$+$J$I!$e(B
ASCII-8BIT e$B$H$J$ke(B or e$B$;$6$k$r$($J$$%1!<%9$,e(B
e$B==J,$KM}2r$G$-$F$$$J$$$?$a$G$9!%e(B

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

From: Tanaka A. [email protected]
Subject: [ruby-dev:33122] Re: Binary String
Date: Tue, 15 Jan 2008 19:08:24 +0900
Message-ID: [email protected]

e$B6qBNE*$JLdBj$NNc$O$"$j$^$;$s$+e(B?

e$B$?$H$($P!"!Ve(BLANG=xxx e$B$Ge(B ruby -e ‘yyy’ e$B$H$9$k$He(B foo e$B$K$J$k$Ne(B
e$B$@$1$l$I$b$=$3$Oe(B bar e$B$K$J$C$F$b$i$o$J$$$H:$$k!W$H$$$&$h$&$J!#e(B

e$B$9$$^$;$s!%8=:<j;}$A$N%5%s%W%k$,$"$j$^$;$s!%e(B
e$B@N!$e(Bascii e$B%F%-%9%H$r$=$N$^$^EO$7$F$$$?$iJ8;z2=$1e(B
(e$B2~9T%3!<%I$NLdBj$r4^$`e(B) e$B$r@8$8$?$N$Ge(B
e$BI,$:e(B toUTF8/fromUTF8 e$B$r$+$^$;$k$h$&$K$7$?$N$G$9$,!$e(B
e$B$=$&$9$k$He(B binary string e$B$r$&$^$/07$($J$/$J$C$?$?$a$Ke(B
Tk::BinaryString e$B$rF3F~$7$?$H$$$&7P0^$+$iMh$F$$$^$9!%e(B

e$B;d$,=R$Y$?e(B MIME e$B$NNc$K$D$$$F$O$I$&$G$9$+e(B?

e$B$4$a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encoding) e$B$G$N=hM}$,MW5a$5$l$?$J$i$P!$e(B
e$BNc30$r>e$2$k$Y$-$G$7$g$&!%e(B
e$B$=$&$7$?Nc30$rL5;k$7$FL$Dj5A$N$^$^07$&$N$G$"$l$P!$e(B
e$B2?$,5/$C$F$be(B (Tk e$B$G$N?dB,8m$j$r4^$a$Fe(B)
e$BJ86g$O8@$($J$$$H;W$$$^$9!%e(B

e$B8!:w$7$F$_$?$H$3$me(B encoding system e$B$Ke(B

| schlenk 2005-06-27: The identity encoding is for testing
| purposes, it should not be used without very good reasons.

e$B$H$$$&5-=R$,$"$j$^$9!#$3$N5-=R$,$I$NDxEY?.MQ$G$-$k$N$+$O$o$+e(B
e$B$i$J$$$N$G$9$,!“e(Bidentity e$B$,e(B binary e$B$G$”$k$H$$$&5,Dj$b8+$D$1e(B
e$B$i$l$^$;$s$G$7$?!#e(Btcl 8.5.0 e$B$He(B tk 8.5.0 e$B$Ne(B doc/ e$B$OC5$7$?$N$Ge(B
e$B$9$,!"e(Bidentity e$B$K4X$9$k5-=R$O$[$H$s$I8+Ev$?$i$:!"e(Bbinary e$B$G$"e(B
e$B$k$H$$$&5-:$O$J$$$h$&$K;W$$$^$9!#e(B

e$B$3$A$i$O;d$NJ}$,FI$s$G$$$^$;$s$G$7$?!%$*CQ$:$+$7$$!%e(B
Tk::BinaryString
e$B$rF3F~;~E@$G$O!$;d$bB8:_$K5$IU$$$F$$$^$;$s$G$7$?!%e(B

identity e$B$,e(B binary e$B$H5,Dj$5$l$F$$$k$H$$$&$N$O$I$3$K=q$$$F$"e(B
e$B$k$N$G$7$g$&e(B?

e$BL@5-$O$J$+$C$?$G$9$M!%e(B
generic/tclEncoding.c e$B$G$NDj5A$G!$e(B

type.toUtfProc = BinaryProc;
type.fromUtfProc = BinaryProc;

e$B$H$J$C$F$$$?$N$Ge(B binary e$BAjEv$H;W$$9~$s$G$^$7$?!%e(B
e$B>!<j$J;W$$9~$$G$9$$^$;$s!%e(B

e$B$I$&$J$s$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$/F0$+$J$$7o$K$D$$$F$OBP=h$G$-$k$H;W$&$N$G$9$,!#e(B

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

From: Hidetoshi NAGAI [email protected]
Subject: [ruby-dev:33126] Re: Binary String
Date: Wed, 16 Jan 2008 10:20:50 +0900
Message-ID: [email protected]

e$B$9$$^$;$s!%8=:<j;}$A$N%5%s%W%k$,$"$j$^$;$s!%e(B
e$B@N!$e(Bascii e$B%F%-%9%H$r$=$N$^$^EO$7$F$$$?$iJ8;z2=$1e(B
(e$B2~9T%3!<%I$NLdBj$r4^$`e(B) e$B$r@8$8$?$N$Ge(B
e$BI,$:e(B toUTF8/fromUTF8 e$B$r$+$^$;$k$h$&$K$7$?$N$G$9$,!$e(B
e$B$=$&$9$k$He(B binary string e$B$r$&$^$/07$($J$/$J$C$?$?$a$Ke(B
Tk::BinaryString e$B$rF3F~$7$?$H$$$&7P0^$+$iMh$F$$$^$9!%e(B

e$B@N$NOC$J$N$G!$5-210c$$$,$"$k$+$b$7$l$^$;$s!%e(B

e$B$b$7$+$7$?$i!$e(Bascii e$B$H8@$$$J$,$i$be(B ascii e$B$G$O$J$$e(B

(e$B%h!<%m%C%Q$Ne(B 8bit char e$B$r4^$`e(B) e$B%1!<%9$@$C$?$+$b!%e(B

e$B4V0c$C$F$$$?$i$4$a$s$J$5$$!%e(B

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

From: “NARUSE, Yui” [email protected]
Subject: [ruby-dev:33138] Re: Binary String
Date: Wed, 16 Jan 2008 23:30:03 +0900
Message-ID: [email protected]

e$B$U!<$`!"$^$!%i%C%Q!<$@$H$=$&$J$C$F$7$^$&$N$G$9$+$M$'!#e(B

e$B$^$!!$JL$N@$3&$H$N4V$G$N;$$j9g$o$;$NLdBj$@$H$O;W$$$^$9$,!$e(B
Ruby e$BB&$G%3!<%I$r=q$$$F$$$k$H$-$K!$e(B
e$BJL$N@$3&$N$3$H$r$G$-$k$@$10U<1$7$J$$$G:Q$`$h$&$K$7$F$"$2$?$$$He(B
e$B9M$($k$H$G$9$M$'!%!%!%e(B(^_^;

e$B$D$^$j!$e(B

  • binary e$B$KBP$7$F$Oe(B ASCII-8BIT e$B$rM?$($k!%e(B

  • ASCII-8BIT e$B$,Mh$?$H$-$K$Oe(B binary e$B$G$"$k$H$7!$0l@ZJQ49$r9T$o$J$$!%e(B

e$B$H$$$&BP1~$G!$8_49@-$r<N$F$ke(B (e$B=>Mh$N%9%/%j%W%H$O6K$a$F9b$$3NN($Ge(B
e$BJ8;z2=$1$9$ke(B) e$B$H$$$&$3$H$K$J$j$^$9!%e(B

e$B$3$l$,%Y%9%H$@$H;W$$$^$9!#e(B

e$B!V8=>u$N$^$^JQ99$J$7$H$$$&$3$H$G$"$l$P!W$G$9$M!%e(B(^_^)

e$B$H$$$&$+!"$9$C$+$jB8:_$rK:$l$F$$$?$s$G$9$,!"e(B
ruby19 --encoding=Windows-31J e$B$H$+$GF0$+$;$P%9%/%j%W%H$K$O<j$rF~$l$:$Ke(B
magic comment e$BAjEv$r;XDj$G$-$^$9$M!#$3$l$Ge(B Ruby 1.8 e$B8~$1$N%3!<%I$,e(B magic
comment e$B$r=q$+$J$$$H$&$^$/F0$+$J$$7o$K$D$$$F$OBP=h$G$-$k$H;W$&$N$G$9$,!#e(B

e$B%3%^%s%I%i%$%s%*%W%7%g%s$rIU$1$F$b!$e(B
ASCII-8BIT e$B$K$J$k$H$-$O$J$C$A$c$$$^$9$h$M!%e(B
e$BNc$($Pe(B

$ ruby19 --encoding=euc-jp -e ‘p “aaa”.encoding’

e$B$H$+$Oe(B ASCII-8BIT e$B$G$9$h$M!%e(B

e$B$3$&$$$&%1!<%9$G$Oe(B US-ASCII e$B$H$+$K$J$C$?J}$,$$$$$N$+$b!)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:33138] Re: Binary String”
on Jan.16,2008 23:30:03, [email protected] wrote:
| ruby19 --encoding=Windows-31J e$B$H$+$GF0$+$;$P%9%/%j%W%H$K$O<j$rF~$l$:$Ke(B
| magic comment e$BAjEv$r;XDj$G$-$^$9$M!#$3$l$Ge(B Ruby 1.8 e$B8~$1$N%3!<%I$,e(B magic
| comment e$B$r=q$+$J$$$H$&$^$/F0$+$J$$7o$K$D$$$F$OBP=h$G$-$k$H;W$&$N$G$9$,!#e(B

e$B$H$$$&$+!“e(B1.9e$B$GF0$+$9;~$Ke(Bmagic
commente$B$+$=$l$KN`$9$k;XDj$,I,e(B
e$BMW$K$J$k$h$&$J%9%/%j%W%H$O!”$=$b$=$be(B1.8e$B$G$be(B-Ke$B$,I,MW$@$C$?$O$:e(B
e$B$G$9!#e(B
e$B$H$$$&$3$H$O!“$=$N%9%/%j%W%H$r<B9T$7$F$$$k?M$O>o$Ke(B-Ke$B$r;XDj$7e(B
e$B$F$$$k$+!”$^$?$Oe(Bshebange$B9T$Ke(B-Ke$B$r=q$$$F$$$k$O$:$G$9!#e(B
e$B$=$7$F!“e(B1.9e$B$Oe(B-Ke$B$r0z$-B3$-8_49@-$N$?$a$K%5%]!<%H$7$F$k$s$@$+$ie(B
1.8e$B$HF1$8$h$&$KF0$+$;$k$O$:!”$J$N$G$9$,e(B…

e$B$J$s$+$:$l$?OC$r$7$F$7$^$C$F$$$k5$$b$7$^$9$,e(B

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

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

From: “U.Nakamura” [email protected]
Subject: [ruby-dev:33140] Re: Binary String
Date: Thu, 17 Jan 2008 09:42:43 +0900
Message-ID: [email protected]

e$B$H$$$&$+!“e(B1.9e$B$GF0$+$9;~$Ke(Bmagic commente$B$+$=$l$KN`$9$k;XDj$,I,e(B
e$BMW$K$J$k$h$&$J%9%/%j%W%H$O!”$=$b$=$be(B1.8e$B$G$be(B-Ke$B$,I,MW$@$C$?$O$:e(B
e$B$G$9!#e(B
e$B$H$$$&$3$H$O!“$=$N%9%/%j%W%H$r<B9T$7$F$$$k?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B

e$B%P%$%J%j$N>l9g$O$3$NJQ49$r$d$k$HEvA3%@%a$K$J$k$N$G!$e(B
e$B!V%P%$%J%j$@$h!W$H0u$r$D$1$k$h$&$K$7$F$$$^$7$?!%e(B
e$B$G!$e(BRuby 1.9 e$B$G$be(B encoding
e$B$rMxMQ$7$F!V%P%$%J%j$@$h!W$He(B
e$B0u$r$D$1$h$&$H$7$?$iL@<($,IT2DG=$G!%!%!%$H$$$&$o$1$G$9!%e(B

e$B@>;3OB9-$G$9!#e(B

At Thu, 17 Jan 2008 16:51:26 +0900,
Hidetoshi NAGAI wrote:

e$B%P%$%J%j$N>l9g$O$3$NJQ49$r$d$k$HEvA3%@%a$K$J$k$N$G!$e(B
e$B!V%P%$%J%j$@$h!W$H0u$r$D$1$k$h$&$K$7$F$$$^$7$?!%e(B
e$B$G!$e(BRuby 1.9 e$B$G$be(B encoding e$B$rMxMQ$7$F!V%P%$%J%j$@$h!W$He(B
e$B0u$r$D$1$h$&$H$7$?$iL@<($,IT2DG=$G!%!%!%$H$$$&$o$1$G$9!%e(B

e$B%P%$%J%j$K!V%P%$%J%j$@$h!W$H0u$r$D$1$i$l$k%?%$%_%s%0$,e(B
e$B$"$k$N$J$i!"$=$3$G%P%$%J%j0J30$NJ}$Ke(BASCII-8BITe$B0J30$Ne(B
encoding(ascii_onlye$B$J$ie(BUS-ASCIIe$B$H$+e(B)e$B$r;XDj$9$k$N$G$Oe(B
e$B$@$a$J$N$G$7$g$&$+e(B?

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

From: Kazuhiro NISHIYAMA [email protected]
Subject: [ruby-dev:33149] Re: Binary String
Date: Thu, 17 Jan 2008 17:29:20 +0900
Message-ID: [email protected]

e$B%P%$%J%j$N>l9g$O$3$NJQ49$r$d$k$HEvA3%@%a$K$J$k$N$G!$e(B
e$B!V%P%$%J%j$@$h!W$H0u$r$D$1$k$h$&$K$7$F$$$^$7$?!%e(B
e$B$G!$e(BRuby 1.9 e$B$G$be(B encoding e$B$rMxMQ$7$F!V%P%$%J%j$@$h!W$He(B
e$B0u$r$D$1$h$&$H$7$?$iL@<($,IT2DG=$G!%!%!%$H$$$&$o$1$G$9!%e(B

e$B%P%$%J%j$K!V%P%$%J%j$@$h!W$H0u$r$D$1$i$l$k%?%$%_%s%0$,e(B
e$B$“$k$N$J$i!”$=$3$G%P%$%J%j0J30$NJ}$Ke(BASCII-8BITe$B0J30$Ne(B
encoding(ascii_onlye$B$J$ie(BUS-ASCIIe$B$H$+e(B)e$B$r;XDj$9$k$N$G$Oe(B
e$B$@$a$J$N$G$7$g$&$+e(B?

e$B$“!$$3$N!V0u$r$D$1$k!W$H$$$&$N$Oe(B Tk e$B"e(B Ruby e$B$N:]$Ke(B
binary string e$B$rJV$9$H$-$N$3$H$G!$e(B
e$B0u$r$D$1$F$
$1$P!$$=$Ne(B string e$B$,e(B Ruby e$B”*e(B Tk e$B$He(B
e$BEO$5$l$k$H$-$K4V0c$($:$K=hM}$G$-$k$H$$$&OC$G$9!%e(B

e$BEvA3$J$,$i!$e(BRuby e$B"+"*e(B Tk
e$B$G$d$j<h$j$5$l$k$9$Y$F$NJ8;zNs$,e(B
e$B$=$3$rDL$k$o$1$G$O$J$$$N$G!$!V%P%$%J%j0J30$NJ}$r$9$Y$Fe(B
ASCII-8BIT e$B0J30$K$9$k!W$H$$$&$N$OL5M}$G$9!%e(B