Forum: Ruby-dev m17n of irb

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
1e7e007723cfe59320d994a7db4ab4cf?d=identicon&s=25 Yugui (Yuki Sonoda) (Guest)
on 2008-11-24 14:09
(Received via mailing list)
Yuguiです。

irbの多言語化を試みてみました。パッチを添付します。この変更により、
* ファイルからコードを読む際にmagic commentを解釈します。
* 
lex結果に正しくencodingを付けるので、__ENCODING__を使うプログラムが正
しく動きます。
* 
Kconvの代わりにString#encodeを使うので、日本語以外についてもうまくメッ
セージを変換できる可能性があります。
* 独自のlocale解析の他にEncoding::LOCALEを使います。

(日本語ヘルプは、どうせならダミーエンコーディングじゃないほうが良いだろ
うと思いまして、ISO-2022-JPからUTF-8に変換しました)


残る問題は-K, -U, 
-Eをどうやってサポートするかです。(必要ですよね?)
* default_internal, default_external, default_src_encodingを設定するメ
ソッドを追加
  => 言語設計ポリシーに反する
* 設定するための拡張ライブラリを書く
  => ほとんど変わらない
* rubyプロセスを再spawnする
  => Ruby処理系のパスを確実に得るポータブルな方法がない
* 設定対象変数のアドレスを取得してdlで無理矢理
  => ポータブルでない

と考えて、IRB.parse_optを拡張ライブラリで書くのが良いのではないかと思い
ました。そんな方向でいかがでしょうか。
97f338629741aa42d6717bfba0c2830f?d=identicon&s=25 keiju ISHITSUKA (Guest)
on 2008-11-25 08:19
(Received via mailing list)
$B$1$$$8$e!w$$$7$D$+$G$9(B.

In [ruby-dev :37161 ] the message: "[ruby-dev:37161] m17n of irb ", on
Nov/24 22:05(JST) "Yugui (Yuki Sonoda)" writes:

>Yugui$B$G$9!#(B
>irb$B$NB?8@8l2=$r;n$_$F$_$^$7$?!#%Q%C%A$rE:IU$7$^$9!#$3$NJQ99$K$h$j!"(B
>* $B%U%!%$%k$+$i%3!<%I$rFI$`:]$K(Bmagic comment$B$r2r<a$7$^$9!#(B
>* lex$B7k2L$K@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$l$K(B, $B$3$NLdBj$O(Birb$B$K8BDj$5$l$k$o$1$G$O$J$/(B,
$B30It$+$i$NJ8;zNs$r(Beval
$B$9$k$h$&$J%W%m%0%i%`$9$Y$F$KEv$F$O$^$j$^$9(B.
$B$=$s$J$KB?$$$H$O8@$$$^$;$s(B
$B$,(B, $B$=$l$J$j$K$"$k$3$H$O3N$+$G(B,
$B:#;d$,3+H/$7$F$$$kJL$N=hM}7O$G$bF1$8Ld(B
$BBj$,$"$j$^$9(B.

default_internal, default_external$B$,:F@_Dj$G$-$J$$$N$O(B,
2$BEY@_Dj$5$l$k(B
$B$H$I$l$,@5$7$$$N$+J,$+$i$J$/$J$k$+$i$H$N$3$H$N$h$&$G$9$,(B,
$B5/F0;~%*%W%7%g(B
$B%s$d4D6-JQ?t(BRUBYOPT$B$G(B-E$B$G;XDj$5$l$F$$$J$+$C$?$i(B,
$B0lEY$@$1$J$iBeF~$,5v(B
$B$5$l$F$bNI$$$H;W$&$N$G$9$,(B, $B$$$+$,$G$7$g$&$+(B?

$B$"$H$O(B, IRB.parse_opt $B$NOC$G5$$,IU$-$^$7$?$,(B,
default_*$B$r@_Dj$7$?$/$J(B
$B$k$N$O(B, $B%"%W%j%1!<%7%g%s$N=i4|2=;~E@$G$9$N$G(B,
lib/optperse.rb $BJU$j$KAH(B
$B$_9~$s$G$7$^$&$H$$$&$N$b$"$j$N$h$&$J5$$,$7$^$9(B. $B$?$@(B,
$B$3$A$i$N>l9g$G$b(B
$B0lIt3HD%%i%$%V%i%j2=$OI,MW$K$J$k$3$H$K$J$j$^$9$,(B,
irb$B8BDj$NBP1~$G$O$J(B
$B$$$N$G(B, $BMxMQ2ACM$O9b$/$J$k$H;W$$$^$9(B.

$B$"$H(B, default_src_encoding$B$C$F2?$G$7$g$&$+(B?
ML$BEy$G$O8+3]$1$^$;$s$,(B?

__
---------------------------------------------------->> $B@PDM(B
$B7=<y(B <<---
---------------------------------->> e-mail: keiju@ishitsuka.com <<---
1e7e007723cfe59320d994a7db4ab4cf?d=identicon&s=25 Yugui (Yuki Sonoda) (Guest)
on 2008-11-26 12:46
(Received via mailing list)
keiju ISHITSUKA さんは書きました:
> うーん. しょうがないんですかねぇ...
>
> それに, この問題はirbに限定されるわけではなく, 
外部からの文字列をeval
> するようなプログラムすべてに当てはまります. 
そんなに多いとは言いません
> が, それなりにあることは確かで, 
今私が開発している別の処理系でも同じ問
> 題があります.

irbがある種のRuby処理系だから発生する問題であってあまり一般的ではないと
思っていました。あまり一般的な問題であっては欲しくないんですけどねー。

> default_internal, default_externalが再設定できないのは, 2度設定される
> とどれが正しいのか分からなくなるからとのことのようですが, 
起動時オプショ
> ンや環境変数RUBYOPTで-Eで指定されていなかったら, 
一度だけなら代入が許
> されても良いと思うのですが, いかがでしょうか?

既にdefault_internal, 
default_externalで開かれたリソースが存在する可能性
があると思います。ですから、変更するならばそのリソースに対して責任を負う
必要があって、あまり気軽に変更して欲しくはないと思います。

言語デザインとしてどうでしょうか? < まつもとさん

言い換えると、「一度だけ代入化」の選択肢ははあり得ますか?
あるんだったら本件は割と簡単になりますよね。

> あとは, IRB.parse_opt の話で気が付きましたが, 
default_*を設定したくな
> るのは, アプリケーションの初期化時点ですので, lib/optperse.rb 
辺りに組
> み込んでしまうというのもありのような気がします. ただ, 
こちらの場合でも
> 一部拡張ライブラリ化は必要になることになりますが, 
irb限定の対応ではな
> いので, 利用価値は高くなると思います.

ちょっとこの話はよく分からないので、風邪が治ったら考えさせてください。


> あと, default_src_encodingって何でしょうか? ML等では見掛けませんが?

ruby.cでいうopt->src.encの意図でした。-Kの時に設定される、magic 
comment
がないときのscript 
encodingです。-Kのとき以外は常にUS-ASCIIです。

それはそうと、IRB.parse_optsの拡張ライブラリ化を書いちゃったのでとりあえ
ず添付しますね。ただ、このパッチではdefault_internalが設定できません。
rb_enc_set_default_internalが1度しか設定を許さないようになっていて、Ruby
本体のオプション解析の時点で設定されるからです。

この辺りも含めて、デフォルトのエンコーディング設定の変更を許すことが言語
デザイン的にあり得るのかどうかまつもとさんに伺いたいです。
私は結構現状に納得してます。
97f338629741aa42d6717bfba0c2830f?d=identicon&s=25 keiju ISHITSUKA (Guest)
on 2008-11-27 16:34
(Received via mailing list)
$B$1$$$8$e!w$$$7$D$+$G$9(B.

In [ruby-dev :37203 ] the message: "[ruby-dev:37203] Re: m17n of irb
", on Nov/26 20:40(JST) "Yugui (Yuki Sonoda)" writes:

>irb$B$,$"$k<o$N(BRuby$B=hM}7O$@$+$iH/@8$9$kLdBj$G$"$C$F$"$^$j0lHLE*$G$O$J$$$H(B
>$B;W$C$F$$$^$7$?!#$"$^$j0lHLE*$JLdBj$G$"$C$F$OM_$7$/$J$$$s$G$9$1$I$M!<!#(B

irb$B$H$+$N>l9g(B,
encoding$B$r;XDj$7$?$$$N$O(Birb$B$N%f!<%6!<$G$9$+$i(B.
$B:#$N$^$^(B
$B$@$H(B ruby $B%l%Y%k$G$O2r7h$G$-$J$$$G$9$h$M(B...

irb$B$N$h$&$JIT2DG=%l%Y%k$N%1!<%9$O(B,
$BIQH/$9$k$b$N$G$b$J$$$G$9$,(B,
default_**_encoding$B$N287C$r<u$1$i$l$J$$>l9g$O(B,
$B$+$J$j0lHLE*$J$b$N$K$J(B
$B$k$H;W$$$^$9(B. $B$H$$$&$N$b(B, default_**_encodig $B$O(B
$B4D6-JQ?t$+(Bruby$B$X$N%*%W(B
$B%7%g%s$G$N;XDj$7$+$J$$$N$G(B, linux$BEy$N%3%^%s%I$H$7$?>l9g(B,
default_**_encoding $B$N;XDj$O(B,
$B4D6-JQ?t$G$7$+=PMh$J$$$3$H$K$J$j$^$9(B. $B$3(B
$B$l$C$F(B, $B$+$J$j$NITJX$@$H;W$&$N$G$9$,(B?

>$B4{$K(Bdefault_internal, default_external$B$G3+$+$l$?%j%=!<%9$,B8:_$9$k2D(B
>$BG=@-$,$"$k$H;W$$$^$9!#(B

$B>/$J$/$H$b(B, std{in,out,err}$B$O3+$$$F$$$^$9$+$i$M$'(B...

> $B$G$9$+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b$H$5$s$K;G$$$?$$$G$9!#(B
>$B;d$O7k9=8=>u$KG<F@$7$F$^$9!#(B

$B$&!<$s(B. $BBg:n$"$j$,$H$&$4$6$$$^$9(B. $B$?$@(B,
$B$3$N$h$&$JJ}K!$8$c$J$/:Q$`$h$&(B
$B$K5'$C$F$$$^$9$,(B(^^;;


__
---------------------------------------------------->> $B@PDM(B
$B7=<y(B <<---
---------------------------------->> e-mail: keiju@ishitsuka.com <<---
9361878d459f1709feec780518946ee5?d=identicon&s=25 NARUSE, Yui (Guest)
on 2008-11-27 17:11
(Received via mailing list)
$B@.@%$G$9!#(B

keiju ISHITSUKA wrote:
> irb$B$N$h$&$JIT2DG=%l%Y%k$N%1!<%9$O(B, $BIQH/$9$k$b$N$G$b$J$$$G$9$,(B,
> default_**_encoding$B$N287C$r<u$1$i$l$J$$>l9g$O(B, $B$+$J$j0lHLE*$J$b$N$K$J(B
> $B$k$H;W$$$^$9(B. $B$H$$$&$N$b(B, default_**_encodig $B$O(B 
$B4D6-JQ?t$+(Bruby$B$X$N%*%W(B
> $B%7%g%s$G$N;XDj$7$+$J$$$N$G(B, linux$BEy$N%3%^%s%I$H$7$?>l9g(B,
> default_**_encoding $B$N;XDj$O(B, $B4D6-JQ?t$G$7$+=PMh$J$$$3$H$K$J$j$^$9(B. $B$3(B
> $B$l$C$F(B, $B$+$J$j$NITJX$@$H;W$&$N$G$9$,(B?

$BIQHK$K$"$k$o$1$G$O$J$$$1$l$I!"Ev$?$k$H$G$+$$LdBj$@$J$!$H;W$$$^$9!#(B

> $B$"$H(B, $B$b$&0l$D$N0F$H$7$F$O(B, #!/bin/env ruby $B$G<B9T$7$?>l9g(B, 
$B%3%^%s%I$N(B
> $B%*%W%7%g%s(B-K, -E, -U $BEy$r(Bruby$BB&$G2r<a$7$F$7$^$&$H$$$&$N$b$"$k$+$H;W(B
> $B$$$^$9(B. $B$?$@(B, $B>o$K2r<a$5$l$k$N$bLdBj$"$k$G$7$g$&$+$i(B, $BNc$($P(B, 
$B%^%8%C%/(B
> $B%3%a%s%H$G(B
>
> #!/bin/env ruby
> # handle option: -K, -E, -U
>
> $B$H$&$H=q$$$F$"$C$?$i(B, $B$=$l$i$N%3%^%s%I%*%W%7%g%s$r(Bruby$BB&$G2r<a$9$k$H$$(B
> $B$&$N$O$$$+$,$G$7$g$&$+(B?

$BJ}8~$H$7$F$O$3$l$,%Y%9%H$8$c$J$$$G$7$g$&$+!#(B
$B$?$@!"%^%8%C%/%3%a%s%H$O$$$^$$$A$+$J$!$H$b!#(B
$B$`$7$m(Bshebang
$B9T$N(Bruby$B$X$N%*%W%7%g%s$H$+$NJ}$,$$$$$+$J!<$H$+!#(B
97f338629741aa42d6717bfba0c2830f?d=identicon&s=25 石塚圭樹 (Guest)
on 2008-11-27 21:33
(Received via mailing list)
$B$1$$$8$e!w$$$7$D$+$G$9(B.

irb$B$K8B$i$J$$LdBj$HG'<1$7$F(B, $B%5%V%8%'%/%HJQ$($^$7$?(B.

In [ruby-dev :37216 ] the message: "[ruby-dev:37216] Re: m17n of irb
", on Nov/28 01:06(JST) "NARUSE, Yui" writes:

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

>> default_**_encoding $B$N;XDj$O(B, $B4D6-JQ?t$G$7$+=PMh$J$$$3$H$K$J$j$^$9(B. 
$B$3(B
>> $B$l$C$F(B, $B$+$J$j$NITJX$@$H;W$&$N$G$9$,(B?
>$BIQHK$K$"$k$o$1$G$O$J$$$1$l$I!"Ev$?$k$H$G$+$$LdBj$@$J$!$H;W$$$^$9!#(B

$B0lHLE*$J(B, $BIQEY$H8@$o$l$k$HJ,$+$j$^$;$s$,(B,

ruby -E... script

$B$H$7$?$/$J$kIQEY$H(B

script -E...

$B$H$7$?$/$J$kIQEY$O(B, $B$=$l$J$j$N%9%/%j%W%H$G$"$l$P(B,
$BIQEY$O$[$H$s$IF1$8$@(B
$B$H;W$$$^$9(B.

$B$H$$$&$o$1$G(B,
$B$o$6$o$6(Bruby$B$N%3%^%s%I%*%W%7%g%s$rMQ0U$9$k$J$i(B,
$B0lHL$N(BOS
$B$N%3%^%s%I$KBP$7$F$b%3%^%s%I%*%W%7%g%s$H$7$FMxMQ$G$-$k$h$&$J2?$i$+$NJ}(B
$BK!$,$"$k$Y$-$@$H;W$&$s$G$9$h$M(B.

>> #!/bin/env ruby
>> # handle option: -K, -E, -U

>$BJ}8~$H$7$F$O$3$l$,%Y%9%H$8$c$J$$$G$7$g$&$+!#(B
>$B$?$@!"%^%8%C%/%3%a%s%H$O$$$^$$$A$+$J$!$H$b!#(B
>$B$`$7$m(Bshebang $B9T$N(Bruby$B$X$N%*%W%7%g%s$H$+$NJ}$,$$$$$+$J!<$H$+!#(B

$B$?$H$($P(B:

#!/bin/env ruby --handle_opt -KEU

$B$J$+$s$8$G$9$h$M(B?

$B;d$b:G=i$O$=$l$r9M$($?$N$G$9$,(B,
shebang$B$O(B1$B0z?t$7$+<h$l$J$+$C$?5$$,$7$?(B
$B$N$G(B, $BA0=R$J46$8$K$7$^$7$?(B.
$B:#$O$=$s$J9MN8$,I,MW$J$1$l$P$`$7$m$=$NJ}$,(B
$BNI$$$H;W$$$^$9(B. $B$3$NJU$j(B, $B$I$&$J$C$F$$$k$s$G$7$g$&$+(B?


__
---------------------------------------------------->> $B@PDM(B
$B7=<y(B <<---
---------------------------------->> e-mail: keiju@ishitsuka.com <<---
Bdcb9af0b168cf425bac2d3772164bee?d=identicon&s=25 Masatoshi SEKI (Guest)
on 2008-11-29 19:59
(Received via mailing list)
$B31$H$$$$$^$9!#(B

On 2008/11/28, at 5:27, $B@PDM7=<y(B wrote:

> $B$1$$$8$e!w$$$7$D$+$G$9(B.
>
> irb$B$K8B$i$J$$LdBj$HG'<1$7$F(B, $B%5%V%8%'%/%HJQ$($^$7$?(B.

bin/erb$B$O4X78$"$j$^$9$h$M!#(B
$B$$$^$O(B$KCODE$B$K4X$9$k%3!<%I$r:o=|$7$?$^$^$G$9!#(B


>
> $B$H;W$$$^$9(B.
$B@5D>8@$&$H!"<+J,$G(Bbin/erb$B$r;H$&$3$H$O3'L5$J$s$G$9$,!"(Birb -K
$B$O$h$/;H$$$^$9!#(B
$BA0$K<+J,MQ$K=q$$$F$$$?%"%W%j%1!<%7%g%s$G$b(B-K$B$O;H$C$F$$$?$N$G!"(B
$B$?$V$s(B
-E$B$b;H$&$h$&$J5$$,$9$k$s$G$9$h$M!#(B

  myapp -E...

$B$H$7$?$+$C$?%"%W%j%1!<%7%g%s$O(B

  ruby -E,,, myapp,rb

$B$H=q$1$P$h$$$N$+$7$i!#(B


>> $BJ}8~$H$7$F$O$3$l$,%Y%9%H$8$c$J$$$G$7$g$&$+!#(B
>> $B$?$@!"%^%8%C%/%3%a%s%H$O$$$^$$$A$+$J$!$H$b!#(B
>> $B$`$7$m(Bshebang $B9T$N(Bruby$B$X$N%*%W%7%g%s$H$+$NJ}$,(B
>> $B$$$$$+$J!<$H$+!#(B

$B%9%/%j%W%H$+$iBeF~$G$-$J$$$N$G$"$l$P!"$3$&$$$C$?:n@o$K;?@.$7$^$9!#(B
0ec4920185b657a03edf01fff96b4e9b?d=identicon&s=25 Yukihiro Matsumoto (Guest)
on 2008-12-06 19:06
(Received via mailing list)
$B$^$D$b$H(B $B$f$-$R$m$G$9(B

Yugui$B$5$s$K$;$C$D$+$l$^$7$?(B($B>P(B

In message "Re: [ruby-dev:37203] Re: m17n of irb"
    on Wed, 26 Nov 2008 20:40:31 +0900, "Yugui (Yuki Sonoda)"
<yugui@yugui.jp> writes:

|$B4{$K(Bdefault_internal, default_external$B$G3+$+$l$?%j%=!<%9$,B8:_$9$k2DG=@-(B
|$B$,$"$k$H;W$$$^$9!#$G$9$+$i!"JQ99$9$k$J$i$P$=$N%j%=!<%9$KBP$7$F@UG$$rIi$&(B
|$BI,MW$,$"$C$F!"$"$^$j5$7Z$KJQ99$7$FM_$7$/$O$J$$$H;W$$$^$9!#(B
|
|$B8@8l%G%6%$%s$H$7$F$I$&$G$7$g$&$+(B? < $B$^$D$b$H$5$s(B
|
|$B8@$$49$($k$H!"!V0lEY$@$1BeF~2=!W$NA*Br;h$O$O$"$jF@$^$9$+(B?
|$B$"$k$s$@$C$?$iK\7o$O3d$H4JC1$K$J$j$^$9$h$M!#(B

default_{internal,external,source}$B$r%$%s%?%W%j%?5/F08e$KJQ99(B
$B$7$?$$$H$$$&OC$G$9$h$M!#$I$&$$$&6ILL$GI,MW$J$k$N$+$h$/$o$+$i(B
$B$J$+$C$?$N$G!"L5H?1~$@$C$?$o$1$G$9$,!#(B

$B$^$:(Bsource encoding$B$K$D$$$F$O(B

  * load$B$O(Bmagic comment$B$rM}2r$7$^$9(B
  * eval$B$O%=!<%9J8;zNs$N(Bencoding$B$r(Bsource
encoding$B$H$7$F2r<a(B
    $B$9$k$N$G!"J8;zNs$N(Bencoding$B$rE,@Z$K@_Dj$9$l$P(Bdefault
    source encoding$B$r;XDj$9$kI,MW$O$J$$$N$G$O(B

$B$H$9$k$H!"(Bload$B$G(Bmagic
comment$B$,$D$$$F$J$$%U%!%$%k$r(BUS-ASCII
$B0J30$H$7$FFI$_9~$_$?$$$H$$$&$+$J$j%l%"%1!<%90J30$G$OFCJL$JBP(B
$B1~$OITMW$G$O$J$$$G$7$g$&$+!#$=$N$h$&$J%1!<%9$G$b%=!<%9$rFI$_(B
$B9~$s$G(Bencoding$B$r@_Dj$7$F(Beval$B$9$l$P$h$$$o$1$G$9$7!#(B

$B$G!"(Bdefault
internal$B$H(Bexternal$B$r@Z$jBX$($k7o$G$9$,!"2~$a$F9M(B
$B$($F$_$k$H5v$7$F$b$h$$$h$&$J5$$,$7$^$9!#%"%W%j%1!<%7%g%sA4BN(B
$B$G6&DL$G$"$k$N$,$*9T57$,NI$$$H$O;W$$$^$9$,!"JQ99$G$-$J$$$3$H(B
$B$r6/@)$7$J$/$F$O$J$i$J$$$[$I<Y0-$G$b$J$$$G$7$g$&!#$"$/$^$G$b(B
default$B$J$N$G!#(B

|$B$3$NJU$j$b4^$a$F!"%G%U%)%k%H$N%(%s%3!<%G%#%s%0@_Dj$NJQ99$r5v$9$3$H$,8@8l(B
|$B%G%6%$%sE*$K$"$jF@$k$N$+$I$&$+$^$D$b$H$5$s$K;G$$$?$$$G$9!#(B
|$B;d$O7k9=8=>u$KG<F@$7$F$^$9!#(B

$B$$$^$5$i(BEncoding.default_external=$B%a%=%C%I$J$I$rDI2C$9$k$H$$(B
$B$&$N$O$I$&$J$s$G$7$g$&$M!#(B

$B$"$H!"(B-E us-ascii $B$G(B default_internal $B$,>!<j$K(B utf-8
$B$K$J$k(B
$B$N$O$"$s$^$jNI$/$J$$$h$&$J5$$,$7$F$-$^$7$?!#(B

                                $B$^$D$b$H(B $B$f$-$R$m(B /:|)
1e7e007723cfe59320d994a7db4ab4cf?d=identicon&s=25 Yugui (Yuki Sonoda) (Guest)
on 2008-12-07 03:48
(Received via mailing list)
Yugui$B$G$9!#(B

Yukihiro Matsumoto $B$5$s$O=q$-$^$7$?(B:
> $B9~$s$G(Bencoding$B$r@_Dj$7$F(Beval$B$9$l$P$h$$$o$1$G$9$7!#(B
$BLdBj$J$N$O(Birb$B$d(Berb$B$G(B-K$B$r;XDj$7$F!"$=$NCf$G(Bmagic
comment$B$NIU$$$F$$$J$$(B
$B%U%!%$%k$r(Bload$B$9$k$H$$$&%l%"$J%1!<%9$@$1$G$9!#(B

-K$B$O$b$H$b$H(B1.8$B8_49@-$N$?$a$N$b$N$HM}2r$7$F$$$^$9$+$i!"(Birb$B$d(Berb$B$G$O%5(B
$B%]!<%H$NI,MW$J$7$H$$$&$N$b#1$D$NA*Br;h$G$9!#0lJ}!"(Birb$B$,$G$-$k$@$1(Bruby$B%3(B
$B%^%s%I$N$h$&$K?6$kIq$&$3$H$r4|BT$9$k$J$i$P!"(Birb$B$N$?$a$@$1$K$O(Bscript
encoding$B$r@_Dj$G$-$J$$$H:$$j$^$9!#(B


$B$G$O;D$j$N(Bdefault_external$B$H(Bdefault_internal$B$K$D$$$F!#(B

$B;d$O!"%G%U%)%k%H!"FC$K(Bdefault_internal$B$,5/F08e$KJQ2=$9$k$N$O4m81$@$H;W$C(B
$B$F$^$9!#4{$K=R$Y$?$h$&$K3+$$$F$7$^$C$?%j%=!<%9$,$"$k$+$b$7$l$^$;$s$7!"%i(B
$B%$%V%i%j$K$`$d$_$K@_Dj$7$FM_$7$/$"$j$^$;$s!#(B

$B$?$@!"(Birb$B$N$h$&$K3N$+$K$=$l$rI,MW$H$9$k;vNc$,$"$k$o$1$G$9!#2f!9$NA[A|$N(B
$B5Z$P$J$$;w$?$h$&$J%1!<%9$,B8:_$9$k$+$b$7$l$^$;$s!#$@$+$i!"(Bdefault_
{internal,external}$B$N(Bsetter$B$rIU$1$k$+$I$&$+$H8@$&$N$O!"$I$NDxEY!V<+J,$N(B
$BB-$r7b$AH4$/<+M3!W$rG'$a$k$+$H$$$&LdBj$G$9!#(B
$BL^O@$^$D$b$H$5$s<!Bh$G$9$1$l$I$b!"G'$a$A$c$C$FNI$$$s$G$9$+(B?

== $B8=>u(B
* irb -K, erb -K$B$OI,MW$+(B?
  YES => script encoding$B$N@_DjJ}K!$,I,MW(B(Ruby$B%l%Y%k$+(BC
API$B$+$OJL(B)
  NO  => $BLdBj$J$7(B

*
$B%(%s%3!<%G%#%s%0$N%G%U%)%k%H$r(BRuby$B%l%Y%k$GJQ99$G$-$k$Y$-$+(B?
  YES => setter$B%a%=%C%IDI2C$G2r7h(B
  NO => IRB.parse_opts$B$N3HD%%i%$%V%i%j2=$G2r7h(B

$B$3$NH=CG$r$^$D$b$H$5$s$K$*4j$$$7$?$/;W$$$^$9!#(B
97f338629741aa42d6717bfba0c2830f?d=identicon&s=25 石塚圭樹 (Guest)
on 2008-12-07 13:58
(Received via mailing list)
$B$1$$$8$e!w$$$7$D$+$G$9(B.

In [ruby-dev :37292 ] the message: "[ruby-dev:37292] Re: m17n of irb
", on Dec/07 02:59(JST) Yukihiro Matsumoto writes:

>$B$^$D$b$H(B $B$f$-$R$m$G$9(B

>default_{internal,external,source}$B$r%$%s%?%W%j%?5/F08e$KJQ99(B
>$B$7$?$$$H$$$&OC$G$9$h$M!#$I$&$$$&6ILL$GI,MW$J$k$N$+$h$/$o$+$i(B
>$B$J$+$C$?$N$G!"L5H?1~$@$C$?$o$1$G$9$,!#(B

ruby$B$G(Blinux$B%3%^%s%I$r:n@.$7$?>l9g$O(B,
$B%$%s%?%W%j%?5/F08e$K$7$+(B,
default_{internal,external,source}
$B$rJQ99$9$k$3$H$O$G$-$J$$$H;W$$$^$9(B
$B$,(B? $B$^$"(B, $B4D6-JQ?t$d(B

ruby -E... -S command

$B$G=PMh$J$/$b$J$$$G$9$,(B, $B$A$g$C$H4*J[$7$FM_$7$$$G$9(B.

>$B9~$s$G(Bencoding$B$r@_Dj$7$F(Beval$B$9$l$P$h$$$o$1$G$9$7!#(B
$B$^$"(B, $B$=$&$J$s$G$9$,(B...
IO$B$H$+$b(Bopen$B$9$k$H$-$K;XDj$G$-$k$N$G$9$+$i(B,
load$B$G(B source encoding $B$,;XDj$G$-$F$bNI$$5$$,$7$^$9(B.

>$B$G!"(Bdefault internal$B$H(Bexternal$B$r@Z$jBX$($k7o$G$9$,!"2~$a$F9M(B
>$B$($F$_$k$H5v$7$F$b$h$$$h$&$J5$$,$7$^$9!#%"%W%j%1!<%7%g%sA4BN(B
>$B$G6&DL$G$"$k$N$,$*9T57$,NI$$$H$O;W$$$^$9$,!"JQ99$G$-$J$$$3$H(B
>$B$r6/@)$7$J$/$F$O$J$i$J$$$[$I<Y0-$G$b$J$$$G$7$g$&!#$"$/$^$G$b(B
>default$B$J$N$G!#(B

$B;d$b<B$N$H$3$m$=$&;W$C$F$$$^$7$?(B. ruby$B$G$O(B,
$B$=$l0J>e$KI]$$$3$H$,4JC1$K(B
$B$G$-$k$o$1$G$9$7(B...


__
---------------------------------------------------->> $B@PDM(B
$B7=<y(B <<---
---------------------------------->> e-mail: keiju@ishitsuka.com <<---
0ec4920185b657a03edf01fff96b4e9b?d=identicon&s=25 Yukihiro Matsumoto (Guest)
on 2008-12-07 15:41
(Received via mailing list)
$B$^$D$b$H(B $B$f$-$R$m$G$9(B

In message "Re: [ruby-dev:37296] Re: m17n of irb"
    on Sun, 7 Dec 2008 21:51:39 +0900, keiju@ishitsuka.com
($B@PDM7=<y(B) writes:

|>default_{internal,external,source}$B$r%$%s%?%W%j%?5/F08e$KJQ99(B
|>$B$7$?$$$H$$$&OC$G$9$h$M!#$I$&$$$&6ILL$GI,MW$J$k$N$+$h$/$o$+$i(B
|>$B$J$+$C$?$N$G!"L5H?1~$@$C$?$o$1$G$9$,!#(B
|
|ruby$B$G(Blinux$B%3%^%s%I$r:n@.$7$?>l9g$O(B, $B%$%s%?%W%j%?5/F08e$K$7$+(B,
|default_{internal,external,source} $B$rJQ99$9$k$3$H$O$G$-$J$$$H;W$$$^$9(B
|$B$,(B? $B$^$"(B, $B4D6-JQ?t$d(B
|
|ruby -E... -S command
|
|$B$G=PMh$J$/$b$J$$$G$9$,(B, $B$A$g$C$H4*J[$7$FM_$7$$$G$9(B.

$B$$$d!"$G$-$k!"$G$-$J$$$NOC$G$O$J$/$F(B($B8=>u$G$-$J$$$N$OEvA3G'<1(B
$B$7$F$$$^$9(B)$B!"$J$<$=$&$7$J$1$l$P$J$i$J$$$N$+$C$F$$$&OC$G$9!#(B
irb$B$H$$$&4D6-$G$G$-$J$/$F$b!"$*$+$7$/$O$J$$$G$9$h$M!#(B
0ec4920185b657a03edf01fff96b4e9b?d=identicon&s=25 Yukihiro Matsumoto (Guest)
on 2008-12-07 16:08
(Received via mailing list)
$B$^$D$b$H(B $B$f$-$R$m$G$9(B

In message "Re: [ruby-dev:37293] Re: m17n of irb"
    on Sun, 7 Dec 2008 11:41:42 +0900, "Yugui (Yuki Sonoda)"
<yugui@yugui.jp> writes:

|$BLdBj$J$N$O(Birb$B$d(Berb$B$G(B-K$B$r;XDj$7$F!"$=$NCf$G(Bmagic 
comment$B$NIU$$$F$$$J$$(B
|$B%U%!%$%k$r(Bload$B$9$k$H$$$&%l%"$J%1!<%9$@$1$G$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DxEY!V<+J,$N(B
|$BB-$r7b$AH4$/<+M3!W$rG'$a$k$+$H$$$&LdBj$G$9!#(B
|$BL^O@$^$D$b$H$5$s<!Bh$G$9$1$l$I$b!"G'$a$A$c$C$FNI$$$s$G$9$+(B?

$B%?%$%_%s%0E*$K%a%=%C%IA}$d$7$F$$$$$s$G$9$+!)(B

|== $B8=>u(B
|* irb -K, erb -K$B$OI,MW$+(B?
|  YES => script encoding$B$N@_DjJ}K!$,I,MW(B(Ruby$B%l%Y%k$+(BC API$B$+$OJL(B)
|  NO  => $BLdBj$J$7(B

NO$B!#8D?ME*$K$OLdBj$J$7$G$O$J$$$+$H;W$C$F$$$^$9!#(B

|* $B%(%s%3!<%G%#%s%0$N%G%U%)%k%H$r(BRuby$B%l%Y%k$GJQ99$G$-$k$Y$-$+(B?
|  YES => setter$B%a%=%C%IDI2C$G2r7h(B
|  NO => IRB.parse_opts$B$N3HD%%i%$%V%i%j2=$G2r7h(B

YES$B!#%j%j!<%9%^%M%8%a%s%HE*$K5v$5$l$k$N$G$"$l$P(Bsetter$B%a%=%C%I(B
$B$NDI2C$,NI$$$N$G$O!#(B
0ec4920185b657a03edf01fff96b4e9b?d=identicon&s=25 Yukihiro Matsumoto (Guest)
on 2008-12-07 16:10
(Received via mailing list)
$B$^$D$b$H(B $B$f$-$R$m$G$9(B

$B$"!"$R$H$DJV;v$r$9$k$N$rK:$l$F$^$7$?!#(B

In message "Re: [ruby-dev:37296] Re: m17n of irb"
    on Sun, 7 Dec 2008 21:51:39 +0900, keiju@ishitsuka.com
($B@PDM7=<y(B) writes:

|$B$^$"(B, $B$=$&$J$s$G$9$,(B... 
IO$B$H$+$b(Bopen$B$9$k$H$-$K;XDj$G$-$k$N$G$9$+$i(B,
|load$B$G(B source encoding $B$,;XDj$G$-$F$bNI$$5$$,$7$^$9(B.

$B!V$G$-$F$bNI$$(B($B$G$-$F$O$$$1$J$$$H$$$&$o$1$G$O$J$$(B)$B!W$N$+$b$7(B
$B$l$^$;$s$,!"I,MW$H$J$k%1!<%9$OLGB?$K$J$$(B($BFC$K(B1.9$B$G$O(B)$B$H$b;W$&(B
$B$N$G!"@Q6KE*$K;?@.$O$7$^$;$s!#(B
97f338629741aa42d6717bfba0c2830f?d=identicon&s=25 石塚圭樹 (Guest)
on 2008-12-07 16:54
(Received via mailing list)
$B$1$$$8$e!w$$$7$D$+$G$9(B.

In [ruby-dev :37297 ] the message: "[ruby-dev:37297] Re: m17n of irb
", on Dec/07 23:34(JST) Yukihiro Matsumoto writes:

>$B$^$D$b$H(B $B$f$-$R$m$G$9(B

>irb$B$H$$$&4D6-$G$G$-$J$/$F$b!"$*$+$7$/$O$J$$$G$9$h$M!#(B
$B$^$"(B, $B@_Dj$G$-$k$h$&$K$J$k$_$?$$$J$N$G(B,
$B$"$^$j94$C$F$b$7$g$&$,$J$$$s$G(B
$B$9$1$I$M(B.

irb$B$H$+4X78$J$7$NOC$G9M$($^$9(B.

ruby -E... script-file

$B$,$7$?$$;~$C$F$I$&$$$&;~$G$9(B? $B$=$l$,$7$?$$$H$-$,$"$k$J$i(B,
script-file
$B$r(B linux-command $B$H$7$F;H$$$?$/$J$C$k>l9g$b$"$k$N$G$O(B?
$B$H8@$&$3$H$,8@(B
$B$$$?$+$C$?$N$G$9(B.

> |$B$^$"(B, $B$=$&$J$s$G$9$,(B... 
IO$B$H$+$b(Bopen$B$9$k$H$-$K;XDj$G$-$k$N$G$9$+$i(B,
> |load$B$G(B source encoding $B$,;XDj$G$-$F$bNI$$5$$,$7$^$9(B.

> $B!V$G$-$F$bNI$$(B($B$G$-$F$O$$$1$J$$$H$$$&$o$1$G$O$J$$(B)$B!W$N$+$b$7(B
> $B$l$^$;$s$,!"I,MW$H$J$k%1!<%9$OLGB?$K$J$$(B($BFC$K(B1.9$B$G$O(B)$B$H$b;W$&(B
> $B$N$G!"@Q6KE*$K;?@.$O$7$^$;$s!#(B

$B$3$A$i$K4X$7$F$O(B, $B;d$NJ}$O$=$l$[$I94$C$F$$$^$;$s(B.
$B>>K\$5$s$,8@$C$F$$$k(B
$B$h$&$K(B, $BLnO:$H;W$($P$I$&$K$+=PMh$^$9$N$G(B.

__
---------------------------------------------------->> $B@PDM(B
$B7=<y(B <<---
---------------------------------->> e-mail: keiju@ishitsuka.com <<---
0ec4920185b657a03edf01fff96b4e9b?d=identicon&s=25 Yukihiro Matsumoto (Guest)
on 2008-12-07 16:59
(Received via mailing list)
$B$^$D$b$H(B $B$f$-$R$m$G$9(B

In message "Re: [ruby-dev:37300] Re: m17n of irb"
    on Mon, 8 Dec 2008 00:47:38 +0900, keiju@ishitsuka.com
($B@PDM7=<y(B) writes:

|ruby -E... script-file
|
|$B$,$7$?$$;~$C$F$I$&$$$&;~$G$9(B? $B$=$l$,$7$?$$$H$-$,$"$k$J$i(B, script-file
|$B$r(B linux-command $B$H$7$F;H$$$?$/$J$C$k>l9g$b$"$k$N$G$O(B? $B$H8@$&$3$H$,8@(B
|$B$$$?$+$C$?$N$G$9(B.

shbang$B$G$N;HMQ$r9M$($F$$$^$9!#$D$^$j!"$=$N%"%W%j%1!<%7%g%s$,(B
$B$I$N$h$&$J%(%s%3!<%G%#%s%0$GF~=PNO$7$?$$$+@k8@$9$k%$%a!<%8$G(B
$B$9$M!#(Birb$B$O%"%W%j%1!<%7%g%s$rAv$i$;$kJlBN$G$O$J$$$N$G!"$=$&(B
$B$$$&$N$OITMW$G$O$J$$$+$H$$$&$N$,;d$NA[Dj$G$9!#(B
1e7e007723cfe59320d994a7db4ab4cf?d=identicon&s=25 Yugui (Yuki Sonoda) (Guest)
on 2008-12-08 03:12
(Received via mailing list)
Yukihiro Matsumoto $B$5$s$O=q$-$^$7$?(B:
> |== $B8=>u(B
> |* irb -K, erb -K$B$OI,MW$+(B?
> |  YES => script encoding$B$N@_DjJ}K!$,I,MW(B(Ruby$B%l%Y%k$+(BC API$B$+$OJL(B)
> |  NO  => $BLdBj$J$7(B
>
> NO$B!#8D?ME*$K$OLdBj$J$7$G$O$J$$$+$H;W$C$F$$$^$9!#(B

$BG<F@$7$^$7$?!#(B

> |* $B%(%s%3!<%G%#%s%0$N%G%U%)%k%H$r(BRuby$B%l%Y%k$GJQ99$G$-$k$Y$-$+(B?
> |  YES => setter$B%a%=%C%IDI2C$G2r7h(B
> |  NO => IRB.parse_opts$B$N3HD%%i%$%V%i%j2=$G2r7h(B
>
> YES$B!#%j%j!<%9%^%M%8%a%s%HE*$K5v$5$l$k$N$G$"$l$P(Bsetter$B%a%=%C%I(B
> $B$NDI2C$,NI$$$N$G$O!#(B

$BL^O@$3$N%?%$%_%s%0$GDI2C$7$?$/$J$$$s$G$9$,!"(Birb
-E$B$,$J$$$^$^%j%j!<%9$9$k(B
$B$h$j$^$7$@$H;W$C$F$$$^$9!#$^$?!"(B1.9.1$B$G(Bdefault_internal,
external$B$NITJQ(B
$B@-$r2>Dj$7$?$^$^%W%m%0%i%`$,=q$+$l$F(B1.9.2$B$GF0$+$J$/$J$k$h$j$O$^$7$@$H(B
$B;W$C$F$$$^$9!#(B
$B0l1~D/$a$?HO0O$G$OITJQ@-$K0MB8$7$F$$$kE:IU%i%$%V%i%j$O$J$5$=$&$J$N$G1F6A(B
$B$O:G>.$K$H$I$^$k$G$7$g$&!#(B

$B$^$D$b$H$5$s$NH=CG$bD:$-$^$7$?$7!"FC$K0[O@$,$J$1$l$P(Bsetter$B$r(Btrunk$B$H(B1.9.1
$B$KDI2C$7$h$&$H;W$$$^$9!#$^$?!"(Birc$B$G:{ED$5$s$HOC$7$^$7$F!V$;$a$F(Bwarning$B$/(B
$B$i$$$O=P$9$,NI$+$m$&!W$H$$$&OC$K$J$j$^$7$?!#(B
97f338629741aa42d6717bfba0c2830f?d=identicon&s=25 石塚圭樹 (Guest)
on 2008-12-08 05:37
(Received via mailing list)
$B$1$$$8$e!w$$$7$D$+$G$9(B.

In [ruby-dev :37301 ] the message: "[ruby-dev:37301] Re: m17n of irb
", on Dec/08 00:52(JST) Yukihiro Matsumoto writes:

>$B$^$D$b$H(B $B$f$-$R$m$G$9(B

$B7kO@=P$F$$$k$N$G(B, $B$$$^$5$i$G$b$J$/$b$J$$$G$9$,(B...

>shbang$B$G$N;HMQ$r9M$($F$$$^$9!#$D$^$j!"$=$N%"%W%j%1!<%7%g%s$,(B
>$B$I$N$h$&$J%(%s%3!<%G%#%s%0$GF~=PNO$7$?$$$+@k8@$9$k%$%a!<%8$G(B
>$B$9$M!#(B

* shbang$B$C$F(BWindows$B$H$+$C$F(BOK$B$J$s$G$9(B?
* shbang $B$C$F0z?t(B1$B$D$^$G$@$H;W$$$^$9(B. env $B$r;H$&$H(B
ruby$B$K$O0z?tEO$;$^$;(B
  $B$s(B.

$B$=$l$K(B,
$B$3$NA0Ds$OF0E*$K$OJQ$($J$$$@$m$&$H$$$&$b$N$@$H;W$$$^$9$,(B,
$B30It(B
$B%(%s%3!<%G%#%s%0$OF0E*$KJQ$($i$l$k$h$&$K$7$?$$$3$H$b$=$l$J$j$K$"$k$H;W(B
$B$&$s$G$9$h$M$'(B. $BNc$($P(B, ruby$B$G:n$C$?(Bgrep$B$H$+(B...
$B$^$"(B, $B$=$&$$$C$?>l9g$O(B
default_external_encoding$B;H$&$J$C$FOC$b$"$k$H$O;W$$$^$9$,(B...

>irb$B$O%"%W%j%1!<%7%g%s$rAv$i$;$kJlBN$G$O$J$$$N$G!"$=$&(B
>$B$$$&$N$OITMW$G$O$J$$$+$H$$$&$N$,;d$NA[Dj$G$9!#(B

$B$(!<$H(B. $B$3$A$i$N0UL#$,NI$/J,$+$j$^$;$s(B...


__
---------------------------------------------------->> $B@PDM(B
$B7=<y(B <<---
---------------------------------->> e-mail: keiju@ishitsuka.com <<---
F1d6cc2b735bfd82c8773172da2aeab9?d=identicon&s=25 Nobuyoshi Nakada (nobu)
on 2008-12-08 07:10
(Received via mailing list)
$B$J$+$@$G$9!#(B

At Mon, 8 Dec 2008 11:05:23 +0900,
Yugui (Yuki Sonoda) wrote in [ruby-dev:37302]:
> $BL^O@$3$N%?%$%_%s%0$GDI2C$7$?$/$J$$$s$G$9$,!"(Birb -E$B$,$J$$$^$^%j%j!<%9$9$k(B
> $B$h$j$^$7$@$H;W$C$F$$$^$9!#$^$?!"(B1.9.1$B$G(Bdefault_internal, 
external$B$NITJQ(B
> $B@-$r2>Dj$7$?$^$^%W%m%0%i%`$,=q$+$l$F(B1.9.2$B$GF0$+$J$/$J$k$h$j$O$^$7$@$H(B
> $B;W$C$F$$$^$9!#(B
> $B0l1~D/$a$?HO0O$G$OITJQ@-$K0MB8$7$F$$$kE:IU%i%$%V%i%j$O$J$5$=$&$J$N$G1F6A(B
> $B$O:G>.$K$H$I$^$k$G$7$g$&!#(B

default_internal, external$B$K0MB8$9$k$h$&$J%i%$%V%i%j$,$=$b$=$b<Y(B
$B0-$J$N$G!"JQ99$G$-$k$h$&$K$7$F(B<del>$B$$$8$a$F(B</del>$B$"$V$j=P$7$F$d(B
$B$k$[$&$,$$$$$H;W$$$^$9!#(B
0ec4920185b657a03edf01fff96b4e9b?d=identicon&s=25 Yukihiro Matsumoto (Guest)
on 2008-12-08 09:52
(Received via mailing list)
$B$^$D$b$H(B $B$f$-$R$m$G$9(B

In message "Re: [ruby-dev:37304] Re: m17n of irb"
    on Mon, 8 Dec 2008 13:30:33 +0900, keiju@ishitsuka.com
($B@PDM7=<y(B) writes:

|>shbang$B$G$N;HMQ$r9M$($F$$$^$9!#$D$^$j!"$=$N%"%W%j%1!<%7%g%s$,(B
|>$B$I$N$h$&$J%(%s%3!<%G%#%s%0$GF~=PNO$7$?$$$+@k8@$9$k%$%a!<%8$G(B
|>$B$9$M!#(B
|
|* shbang$B$C$F(BWindows$B$H$+$C$F(BOK$B$J$s$G$9(B?
|* shbang $B$C$F0z?t(B1$B$D$^$G$@$H;W$$$^$9(B. env $B$r;H$&$H(B 
ruby$B$K$O0z?tEO$;$^$;(B
|  $B$s(B.

Ruby$B$O<+NO$G2r@O$7$^$9!#(B

|$B$=$l$K(B, $B$3$NA0Ds$OF0E*$K$OJQ$($J$$$@$m$&$H$$$&$b$N$@$H;W$$$^$9$,(B, $B30It(B
|$B%(%s%3!<%G%#%s%0$OF0E*$KJQ$($i$l$k$h$&$K$7$?$$$3$H$b$=$l$J$j$K$"$k$H;W(B
|$B$&$s$G$9$h$M$'(B. $BNc$($P(B, ruby$B$G:n$C$?(Bgrep$B$H$+(B... $B$^$"(B, 
$B$=$&$$$C$?>l9g$O(B
|default_external_encoding$B;H$&$J$C$FOC$b$"$k$H$O;W$$$^$9$,(B...
|
|>irb$B$O%"%W%j%1!<%7%g%s$rAv$i$;$kJlBN$G$O$J$$$N$G!"$=$&(B
|>$B$$$&$N$OITMW$G$O$J$$$+$H$$$&$N$,;d$NA[Dj$G$9!#(B
|
|$B$(!<$H(B. $B$3$A$i$N0UL#$,NI$/J,$+$j$^$;$s(B...

irb$B$O!VBPOCE*$K(BRuby$B%W%m%0%i%`$r<B9T$9$k%W%m%0%i%`!W$G$"$C$F!"(B
Ruby$B%$%s%?%W%j%?$N$h$&$K!V$9$G$KB8:_$9$k%U%!%$%k$r<B9T$9$k%W(B
$B%m%0%i%`!W$G$O$J$$$H$$$&0UL#$G$9!#(B
D37d474748a040cddbbc04774701d4ce?d=identicon&s=25 Takahiro Kambe (Guest)
on 2008-12-08 10:53
(Received via mailing list)
In message <E1L9bqd-0001Nk-P8@x61.netlab.jp>
  on Mon, 8 Dec 2008 17:45:47 +0900,
  Yukihiro Matsumoto <matz@ruby-lang.org> wrote:
>
> Ruby$B$O<+NO$G2r@O$7$^$9!#(B
$B<+NO$G2r@O$9$k%W%i%C%H%U%)!<%`$O(BWindows$B$G$NOC$G$7$g$&$+(B?

$B%7%9%F%`$K$h$j$^$9$,!"(B"#!"$B$r2r<a$7$F!"%$%s%?!<%W%j%?$H0z?t$K2r<a$7$F(B
$B5/F0$9$k=hM}$O%+!<%M%k$G9T$$$^$9!#$=$3$G!"<B9T8"$N$"$k%U%!%$%k(Bscript$B$,(B

  #! command arg

$B$@$H(B command $B$K(B arg
$B$rBh(B1$B0z?t!"85$N%9%/%j%W%H$rBh(B2$B0z?t$H$7$F5/F0$9$k$3(B
$B$H$K$J$j$^$9!#$3$N$?$a!"(Barg$B$r%9%Z!<%9$G6h@Z$C$FJ#?tEO$7$?$D$b$j$G$b!"(B

  #! command a b c

command$B$NBh(B1$B0z?t$K$O(B "a b c"$B$H$7$FEO$j$^$9!#$3$N$?$a!"(B

  #! env ruby -v

$B$H$+$9$k$H!"(Benv$B$O(B "ruby -v"
$B$H$$$&%W%m%0%i%`$r<B9T$7$h$&$H$7$F!"(B

  env: ruby -v: No such file or directory

$B$H$J$C$F$7$^$$$^$9!#(Bruby$B$,<+J,$G2r<a$9$k$h$j$bA0$K!"(Bruby$B$r(Benv$B$,5/F0$G(B
$B$-$^$;$s!#$&$^$/$$$/%7%9%F%`$b$"$k$N$+$b$7$l$^$;$s$,!"0J>e$O(B
NetBSD $B>e(B
$B$G3NG'$7$F$$$^$9!#(B

$B$H!"$$$&OC$r@PDM$5$s$O8@$$$?$+$C$?$N$G$O$J$$$G$7$g$&$+(B?

($B$b$C$H$b!"K\$A$c$s$G$O(B shbang $B$J9T$K(B env
$B$J$s$F;H$C$A$c%@%a$@$H;W$&!#(B)
97f338629741aa42d6717bfba0c2830f?d=identicon&s=25 石塚圭樹 (Guest)
on 2008-12-08 11:36
(Received via mailing list)
$B$1$$$8$e!w$$$7$D$+$G$9(B.

In [ruby-dev :37307 ] the message: "[ruby-dev:37307] Re: m17n of irb
", on Dec/08 17:45(JST) Yukihiro Matsumoto writes:

>$B$^$D$b$H(B $B$f$-$R$m$G$9(B

>|* shbang$B$C$F(BWindows$B$H$+$C$F(BOK$B$J$s$G$9(B?
>|* shbang $B$C$F0z?t(B1$B$D$^$G$@$H;W$$$^$9(B. env $B$r;H$&$H(B 
ruby$B$K$O0z?tEO$;$^$;(B
>|  $B$s(B.
>
>Ruby$B$O<+NO$G2r@O$7$^$9!#(B

$B=PMh$F$J$$$_$?$$$G$9$h(B?

#!/usr/local/bin/ruby -Eeuc-jp:utf-8 -Ke

$B$N$H$-(B,

/usr/local/bin/ruby: unknown encoding name - utf-8  -Ke (RuntimeError)

$B$C$F%(%i!<$,=P$^$9(B. $B$^$?(B,

#!/usr/local/bin/ruby -Ke -Eeuc-jp:utf-8

$B$@$H(B,

/usr/local/bin/ruby: invalid option -   (-h will show valid options)
(RuntimeError)

$B$H$J$j$^$9(B.

$B$^$"(B, $B$3$l$O$J$*$k5$$,$7$^$9$,(B...

env$B$r;H$&$H(B,
env$B<+?H$K%*%W%7%g%s$,(B1$B$D$NJ8;zNs$H$7$FEO$5$l$k$N$G(B, ruby
$B$N<B9T$=$N$b$N$,$G$-$^$;$s(B. $B8D?ME*$K;H$&$J$i(B,
ruby$B$ND>@\%Q%9;XDj$b$"$k(B
$B$G$7$g$&$,(B, $B9-$/G[I[$7$?$$$H$-$K$O(B,
env$B$,;H$($J$$$N$O$A$g$C$H87$7$$$G(B
$B$9$M(B.

>|$B$=$l$K(B, $B$3$NA0Ds$OF0E*$K$OJQ$($J$$$@$m$&$H$$$&$b$N$@$H;W$$$^$9$,(B, $B30It(B
>|$B%(%s%3!<%G%#%s%0$OF0E*$KJQ$($i$l$k$h$&$K$7$?$$$3$H$b$=$l$J$j$K$"$k$H;W(B
>|$B$&$s$G$9$h$M$'(B. $BNc$($P(B, ruby$B$G:n$C$?(Bgrep$B$H$+(B... $B$^$"(B, 
$B$=$&$$$C$?>l9g$O(B
>|default_external_encoding$B;H$&$J$C$FOC$b$"$k$H$O;W$$$^$9$,(B...

$B$"$H(B, $B$3$N>l9g$b(B,
$B;d$O$=$l$J$j$N<{MW$,$"$k$H;W$&$s$G$9$1$I$M$'(B.

>irb$B$O!VBPOCE*$K(BRuby$B%W%m%0%i%`$r<B9T$9$k%W%m%0%i%`!W$G$"$C$F!"(B
>Ruby$B%$%s%?%W%j%?$N$h$&$K!V$9$G$KB8:_$9$k%U%!%$%k$r<B9T$9$k%W(B
>$B%m%0%i%`!W$G$O$J$$$H$$$&0UL#$G$9!#(B

$B$"$"(B, $B$=$&$$$&0UL#$G$9$+(B. $B<BMQ>e(B, default_...
$B$H$+$,@_Dj$G$-$J$/$F$bLd(B
$BBj$J$$$C$F$3$H$G$9$M(B? $B3N$+$K(B,
$B<BMQ>e$N$3$H$@$1$r9M$($l$P(B, $B$=$s$J5$$O$7(B
$B$^$9(B.

$B$?$@(B, $B%i%$%V%i%j$N%G%P%C%0$K(Birb$B$H$+NI$/;H$$$^$9$N$G(B.
$B$=$NA0Ds$O$=$l$[(B
$B$I@5$7$$$H$b8@$($J$$$H;W$$$^$9$,(B.


__
---------------------------------------------------->> $B@PDM(B
$B7=<y(B <<---
---------------------------------->> e-mail: keiju@ishitsuka.com <<---
97f338629741aa42d6717bfba0c2830f?d=identicon&s=25 石塚圭樹 (Guest)
on 2008-12-08 11:47
(Received via mailing list)
$B$1$$$8$e!w$$$7$D$+$G$9(B.

$B@h$K%]%9%H$5$l$F$$$^$7$?$M(B(^^;

In [ruby-dev :37313 ] the message: "[ruby-dev:37313] Re: m17n of irb
", on Dec/08 18:46(JST) Takahiro Kambe writes:

>> Ruby$B$O<+NO$G2r@O$7$^$9!#(B
>$B<+NO$G2r@O$9$k%W%i%C%H%U%)!<%`$O(BWindows$B$G$NOC$G$7$g$&$+(B?

$B$=$&$@$C$?$N$+$J(B?

>$B$H$+$9$k$H!"(Benv$B$O(B "ruby -v" $B$H$$$&%W%m%0%i%`$r<B9T$7$h$&$H$7$F!"(B
>  env: ruby -v: No such file or directory
>$B$H$J$C$F$7$^$$$^$9!#(Bruby$B$,<+J,$G2r<a$9$k$h$j$bA0$K!"(Bruby$B$r(Benv$B$,5/F0$G(B
>$B$-$^$;$s!#$&$^$/$$$/%7%9%F%`$b$"$k$N$+$b$7$l$^$;$s$,!"0J>e$O(B NetBSD $B>e(B
>$B$G3NG'$7$F$$$^$9!#(B
>
>$B$H!"$$$&OC$r@PDM$5$s$O8@$$$?$+$C$?$N$G$O$J$$$G$7$g$&$+(B?

env $B$K4X$7$F$O$=$&$G$9(B,
$BD>@\(Bruby$B$r;XDj$7$?>l9g$G$b(B2$B0z$-;X?t$O(BNG$B$K$J$j(B
$B$^$9(B.

>($B$b$C$H$b!"K\$A$c$s$G$O(B shbang $B$J9T$K(B env $B$J$s$F;H$C$A$c%@%a$@$H;W$&!#(B)

$B3N$K$=$&$$$o$l$l$P$=$s$J5$$b$7$^$9(B.

$B$=$&$9$k$H(B, shbabg$B$GD>@\(Bruby$B$r;XDj$7$F(B,
-E$B$r;XDj$9$k$@$1$J$iLdBj$J$$$C(B
$B$F$3$H$K$J$j$^$9$+(B. -K$B$O;XDj$9$kI,MW$O$J$$$G$9$+$i$M(B.


__
---------------------------------------------------->> $B@PDM(B
$B7=<y(B <<---
---------------------------------->> e-mail: keiju@ishitsuka.com <<---
1e7e007723cfe59320d994a7db4ab4cf?d=identicon&s=25 Yugui (Yuki Sonoda) (Guest)
on 2008-12-08 15:11
(Received via mailing list)
Yugui$B$G$9!#(B

Yukihiro Matsumoto $B$5$s$O=q$-$^$7$?(B:
> YES$B!#%j%j!<%9%^%M%8%a%s%HE*$K5v$5$l$k$N$G$"$l$P(Bsetter$B%a%=%C%I(B
> $B$NDI2C$,NI$$$N$G$O!#(B
>

$B%Q%C%A$r=q$3$&$H$7$?$i!"(BEncoding.default_internal = nil$B$O(B
Encoding::INTERNAL$BDj?t$N:o=|$r0UL#$9$k$N$G7k9=OC$,Lq2p$J$3$H$K5$$E$-$^$7(B
$B$?!#8=>u$G$O(Bdefault_internal$B$,;XDj$5$l$J$$>l9g$O(BEncoding::INTERNAL$B$ODj5A(B
$B$5$l$^$;$s$N$G!"0l4S@-$+$i!#(B

[ruby-dev:37000]$B$G>/$7$@$1OC$,=P$F!"(Bdefault_internal$B$,;XDj$5$l$F$$$J$$>l(B
$B9g$ODj?t$b(BEncoding.aliases$B$K$b!"$=$b$=$b(Bdefault_internal$B$H$$$&$b$N$,B8:_(B
$B$7$J$$!"$H$$$&$3$H$K$J$j$^$7$?!#(B

$B$1$l$I$b!"5U$K(BEncoding::INTERNAL$BDj?t$O>o$KM_$7$$$H;W$$$^$9!#$J$<$J$i$P!"(B
Encoding::INTERNAL$B$X$N%"%/%;%9$rI,MW$H$9$k$N$O$I$N$_$A(BIO$B7O%i%$%V%i%j$N$h(B
$B$&$J!"$=$l<+BN$,(Binternal_encoding$B$r;}$D%*%V%8%'%/%H$G$7$g$&$+$i!#Dj?t$,(B
$BDj5A$5$l$F$$$J$$%1!<%9$,B8:_$9$k$H7k6I(B

 def self.open(locator, external = nil, internal = nil)
   external ||= Encoding::EXTERNAL
   internal ||= Encoding::INTERNAL if defined?(Encoding::INTERNAL)
   res = SomeInternalResource.open(locator, external, internal)
   ...
 end

$B$N$h$&$JITLS$J%3!<%G%#%s%047=,$r;:$`$N$G$O$J$$$G$7$g$&$+!#(B

setter$B$,$"$k$3$H<+BN!"(B-E$B$G;XDj$r<u$1$J$+$C$?%W%m%;%9$K$*$$$F$b2?$+$7$i(B
default_internal$B$H$$$&35G0$,B8:_$7$($k$H$$$&0UL#$G$b$"$j$^$9!#$3$N5!2q$K(B
$BL$;XDj;~$O(Bnil$B$G!"(BEncoding::INTERNAL$BDj?t$r>o$KDj5A$9$k$3$H$rDs0F$7$^$9!#(B
0ec4920185b657a03edf01fff96b4e9b?d=identicon&s=25 Yukihiro Matsumoto (Guest)
on 2008-12-08 15:14
(Received via mailing list)
$B$^$D$b$H(B $B$f$-$R$m$G$9(B

In message "Re: [ruby-dev:37314] Re: m17n of irb"
    on Mon, 8 Dec 2008 19:28:46 +0900, keiju@ishitsuka.com
($B@PDM7=<y(B) writes:

|>Ruby$B$O<+NO$G2r@O$7$^$9!#(B
|
|$B=PMh$F$J$$$_$?$$$G$9$h(B?
|
|#!/usr/local/bin/ruby -Eeuc-jp:utf-8 -Ke
|
|$B$N$H$-(B,
|
|/usr/local/bin/ruby: unknown encoding name - utf-8  -Ke (RuntimeError)
|
|$B$C$F%(%i!<$,=P$^$9(B.

$B$9$_$^$;$s!"<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0%i%`!W$G$O$J$$$H$$$&0UL#$G$9!#(B
|
|$B$"$"(B, $B$=$&$$$&0UL#$G$9$+(B. $B<BMQ>e(B, default_... 
$B$H$+$,@_Dj$G$-$J$/$F$bLd(B
|$BBj$J$$$C$F$3$H$G$9$M(B? $B3N$+$K(B, $B<BMQ>e$N$3$H$@$1$r9M$($l$P(B, 
$B$=$s$J5$$O$7(B
|$B$^$9(B.

$B$G$7$g!#(B

|$B$?$@(B, $B%i%$%V%i%j$N%G%P%C%0$K(Birb$B$H$+NI$/;H$$$^$9$N$G(B. 
$B$=$NA0Ds$O$=$l$[(B
|$B$I@5$7$$$H$b8@$($J$$$H;W$$$^$9$,(B.

$B%i%$%V%i%j$O(Bdefault_external$B$KMj$k$Y$-$G$O$J$$$H;W$$$^$9!#(B
default_external$B$O$"$/$^$G$bJQ?t$G$9$+$i!"$*9T57$NNI$$%i%$%V(B
$B%i%j$O$=$NCM$K$h$i$:F0:n$9$Y$-$G$O$J$$$+$H;W$$$^$9!#$*9T57$N(B
$B0-$$%i%$%V%i%j$r;Y1g$9$kI,MW$O$J$$$N$G$O$J$$$+$H!#(B

$B$?$@!"(Bdefault_internal$B$K$D$$$F$O!"$=$NCM$K4X$i$:F0:n$;$h$H8@(B
$B$&$N$OBgJQ$@$H;W$$$^$9$N$G!"(BUTF-8$B$rMQ$$$?(BUCS$B$O!V$*9T57$NNI$$!W(B
$BHO0OFb$K4^$a$F$bNI$$$H;W$$$^$9!#$,!"$=$N>l9g$K$O%*%W%7%g%s(B
$B$O(B-U$B$r;XDj$9$l$P$h$$$o$1$G$9$+$i!"(Bshbang$B$K4JC1$K;XDj$G$-$^$9(B
$B$M!#(B

                                $B$^$D$b$H(B $B$f$-$R$m(B /:|)
0ec4920185b657a03edf01fff96b4e9b?d=identicon&s=25 Yukihiro Matsumoto (Guest)
on 2008-12-08 15:21
(Received via mailing list)
$B$^$D$b$H(B $B$f$-$R$m$G$9(B

In message "Re: [ruby-dev:37320] Proposal to always define
Encoding::INTERNAL; was: Re: m17n of irb"
    on Mon, 8 Dec 2008 23:05:02 +0900, "Yugui (Yuki Sonoda)"
<yugui@yugui.jp> writes:

|$B%Q%C%A$r=q$3$&$H$7$?$i!"(BEncoding.default_internal = nil$B$O(B
|Encoding::INTERNAL$BDj?t$N:o=|$r0UL#$9$k$N$G7k9=OC$,Lq2p$J$3$H$K5$$E$-$^$7(B
|$B$?!#8=>u$G$O(Bdefault_internal$B$,;XDj$5$l$J$$>l9g$O(BEncoding::INTERNAL$B$ODj5A(B
|$B$5$l$^$;$s$N$G!"0l4S@-$+$i!#(B

Encoding::INTERNAL$B$J$s$FDj?t!"$$$D$+$i$"$k$s$G$7$?$C$1!)(B

|setter$B$,$"$k$3$H<+BN!"(B-E$B$G;XDj$r<u$1$J$+$C$?%W%m%;%9$K$*$$$F$b2?$+$7$i(B
|default_internal$B$H$$$&35G0$,B8:_$7$($k$H$$$&0UL#$G$b$"$j$^$9!#$3$N5!2q$K(B
|$BL$;XDj;~$O(Bnil$B$G!"(BEncoding::INTERNAL$BDj?t$r>o$KDj5A$9$k$3$H$rDs0F$7$^$9!#(B

setter$B$GDj?t$NCM$,JQ$o$k$s$G$7$g$&$+!#(B

$B8D?ME*$K$O$`$7$m(BEncoding::INTERNAL$BDj?t$r:o=|$7$?J}$,$h$$$N$G(B
$B$O$J$$$+$H;W$$$^$9$,!#$"$H!"(B"internal"$B%(%s%3!<%G%#%s%0$NCM$,(B
setter$B$K$h$C$FJQ2=$9$k$+$I$&$+$b5$$K$J$j$^$9$M!#(B
1e7e007723cfe59320d994a7db4ab4cf?d=identicon&s=25 Yugui (Yuki Sonoda) (Guest)
on 2008-12-09 02:56
(Received via mailing list)
Yugui$B$G$9!#(B

Yukihiro Matsumoto $B$5$s$O=q$-$^$7$?(B:
> setter$B$GDj?t$NCM$,JQ$o$k$s$G$7$g$&$+!#(B
>
> $B8D?ME*$K$O$`$7$m(BEncoding::INTERNAL$BDj?t$r:o=|$7$?J}$,$h$$$N$G(B
> $B$O$J$$$+$H;W$$$^$9$,!#$"$H!"(B"internal"$B%(%s%3!<%G%#%s%0$NCM$,(B
> setter$B$K$h$C$FJQ2=$9$k$+$I$&$+$b5$$K$J$j$^$9$M!#(B

$B$"!<!"3N$+$K(BEncoding.internal_encoding=
$B$G0l8+L54X78$JDj?t$NCM$,=q$-49$o(B
$B$k$N$O$+$J$j0[MM$J$b$N$,$"$j$^$9$M!#$=$N$[$&$,NI$5$=$&$G$9!#(B
$BBP>N@-$N0UL#$G!"(BEncoding::EXTERNAL$BDj?t$O$I$&$*9M$($G$7$g$&$+(B?

"internal"$B%(%s%3!<%G%#%s%0$NCM!"$H$$$&$N$O(B

 Encoding.find("internal")

$B$N0U$G$7$g$&$+(B?$B!!$3$l$O@_Dj$5$l$l$P0l=o$KJQ2=$9$Y$-$@$H;W$$$^$9!#0lJ}(B
$B$G!"4{$K<hF@$5$l$F(BEncoding$B%*%V%8%'%/%H$N7A$GF@$i$l$F$$$k(Binternal$B%(%s%3!<(B
$B%G%#%s%0$OJQ2=$9$Y$-$G$J$$$H;W$$$^$9!#(B


$B$^$?!"8=>u$G(Bdefault_internal$B$,@_Dj$5$l$F$$$J$$$H(B

 ArgumentError: unknown encoding name - internal

$B$G$9!#$3$l$O!"(BEncoding::INTERNAL$B$,(B($B$b$7Dj5A$5$l$k$3$H$K$J$C$F$$$?$J$i$P(B)
$B>o$KDj5A$5$l$k$Y$-$G$"$C$?$N$HF1$8M}M3$G!">o$K<hF@$G$-$k$Y$-$@$H;W$$$^(B
$B$9!#$5$b$J$/$P!"(B

  enc && enc == 'internal' ? Encoding.find(enc) :
Encoding.default_internal

$B$H$$$&%$%G%#%*%`$,L50UL#$K$O$S$3$k$@$1$G$7$g$&!#(B
0ec4920185b657a03edf01fff96b4e9b?d=identicon&s=25 Yukihiro Matsumoto (Guest)
on 2008-12-09 05:40
(Received via mailing list)
$B$^$D$b$H(B $B$f$-$R$m$G$9(B

In message "Re: [ruby-dev:37326] Re: Proposal to always define
Encoding::INTERNAL; was: Re: m17n of irb"
    on Tue, 9 Dec 2008 10:49:54 +0900, "Yugui (Yuki Sonoda)"
<yugui@yugui.jp> writes:

|$B$"!<!"3N$+$K(BEncoding.internal_encoding= $B$G0l8+L54X78$JDj?t$NCM$,=q$-49$o(B
|$B$k$N$O$+$J$j0[MM$J$b$N$,$"$j$^$9$M!#$=$N$[$&$,NI$5$=$&$G$9!#(B
|$BBP>N@-$N0UL#$G!"(BEncoding::EXTERNAL$BDj?t$O$I$&$*9M$($G$7$g$&$+(B?

$B$=$l$b:o=|$7$?J}$,$h$$$h$&$K;W$$$^$9!#(B

|"internal"$B%(%s%3!<%G%#%s%0$NCM!"$H$$$&$N$O(B
|
| Encoding.find("internal")
|
|$B$N0U$G$7$g$&$+(B?$B!!$3$l$O@_Dj$5$l$l$P0l=o$KJQ2=$9$Y$-$@$H;W$$$^$9!#0lJ}(B
|$B$G!"4{$K<hF@$5$l$F(BEncoding$B%*%V%8%'%/%H$N7A$GF@$i$l$F$$$k(Binternal$B%(%s%3!<(B
|$B%G%#%s%0$OJQ2=$9$Y$-$G$J$$$H;W$$$^$9!#(B

$B!V0l=o$KJQ2=$9$Y$-!W$H$$$&E@$K;?@.$G$9!#$^$?!"(Binternal$B$O$"$/(B
$B$^$G$b(Balias$B$J$N$G!"<h$j=P$5$l$?%(%s%3!<%G%#%s%0$O(Binternal$B$H(B
$B$$$&L>A0$G$O$J$$$N$G!"JQ2=$7$J$$$N$OEvA3$@$H;W$$$^$9!#(B

|$B$^$?!"8=>u$G(Bdefault_internal$B$,@_Dj$5$l$F$$$J$$$H(B
|
| ArgumentError: unknown encoding name - internal
|
|$B$G$9!#$3$l$O!"(BEncoding::INTERNAL$B$,(B($B$b$7Dj5A$5$l$k$3$H$K$J$C$F$$$?$J$i$P(B)
|$B>o$KDj5A$5$l$k$Y$-$G$"$C$?$N$HF1$8M}M3$G!">o$K<hF@$G$-$k$Y$-$@$H;W$$$^(B
|$B$9!#(B

$B!V>o$K<hF@$G$-$k$Y$-!W$G$J$$$H!V%$%G%#%*%`$,L50UL#$K$O$S$3$k!W(B
$B$H$$$&E@$K$bF10U$7$^$9!#$7$+$7!"(Bdefault_internal$B$,@_Dj$5$l$F(B
$B$$$J$$;~$N(BEncoding.find("internal")$B$NCM$O$I$&$"$k$Y$-$J$s$G$7$g(B
$B$&$+!#(B

|  enc && enc == 'internal' ? Encoding.find(enc) : Encoding.default_internal

$B$H$$$&%$%G%#%*%`$K=>$&$N$G$"$l$P(Bnil$B$J$o$1$G$9$,!#(Binternal$B$r(B
$BFCNc$K$9$k!)(B

                                $B$^$D$b$H(B $B$f$-$R$m(B /:|)
1e7e007723cfe59320d994a7db4ab4cf?d=identicon&s=25 Yugui (Yuki Sonoda) (Guest)
on 2008-12-09 09:18
(Received via mailing list)
Yukihiro Matsumoto $B$5$s$O=q$-$^$7$?(B:
> $B!V>o$K<hF@$G$-$k$Y$-!W$G$J$$$H!V%$%G%#%*%`$,L50UL#$K$O$S$3$k!W(B
> $B$H$$$&E@$K$bF10U$7$^$9!#$7$+$7!"(Bdefault_internal$B$,@_Dj$5$l$F(B
> $B$$$J$$;~$N(BEncoding.find("internal")$B$NCM$O$I$&$"$k$Y$-$J$s$G$7$g(B
> $B$&$+!#(B
>
> |  enc && enc == 'internal' ? Encoding.find(enc) : Encoding.default_internal
>
> $B$H$$$&%$%G%#%*%`$K=>$&$N$G$"$l$P(Bnil$B$J$o$1$G$9$,!#(Binternal$B$r(B
> $BFCNc$K$9$k!)(B

$B$($(!#(Bdefault_internal$B$rMxMQ$9$k6ILL$K$*$$$F$O(Bencoding$B$K(Bnil(=$BL5JQ49(B)$B$rEO(B
$B$;$k$3$H$r4|BT$G$-$^$9$+$i!"(BEncoding.find("internal") => nil
$B$GNI$$$H;W(B
$B$$$^$9!#(B

$B$"!"$b$&0l$DK:$l$F$$$^$7$?!#(B
Encoding::EXTERNAL,
Encoding::INTERNAL$B$+$i$NN`?d$G(BEncoding::LOCALE$B$rA0$K(B
$BF~$l$F$b$i$C$?$s$G$9$,!"A0<T(B2$B$D$r:o$k$H!"(BLOCALE$B$b:o$C$?J}$,$h$$$G$9$+(B?
0ec4920185b657a03edf01fff96b4e9b?d=identicon&s=25 Yukihiro Matsumoto (Guest)
on 2008-12-09 09:24
(Received via mailing list)
$B$^$D$b$H(B $B$f$-$R$m$G$9(B

In message "Re: [ruby-dev:37330] Re: Proposal to always define
Encoding::INTERNAL; was: Re: m17n of irb"
    on Tue, 9 Dec 2008 17:11:49 +0900, "Yugui (Yuki Sonoda)"
<yugui@yugui.jp> writes:

|$B$($(!#(Bdefault_internal$B$rMxMQ$9$k6ILL$K$*$$$F$O(Bencoding$B$K(Bnil(=$BL5JQ49(B)$B$rEO(B
|$B$;$k$3$H$r4|BT$G$-$^$9$+$i!"(BEncoding.find("internal") => nil $B$GNI$$$H;W(B
|$B$$$^$9!#(B

$B8=>u$G$O(BEncoding#find$B$O!V8+$D$+$i$J$$;~%(%i!<!W$H$$$&;EMM$@(B
$B$H;W$$$^$9$,!"$3$l$O(B

  * internal$B$K8B$j(Bnil
  * $B8+$D$+$i$J$$;~$K(Bnil$B$KJQ99(B

$B$N$$$:$l$rA[Dj$7$F$$$^$9$+!)(B

|$B$"!"$b$&0l$DK:$l$F$$$^$7$?!#(B
|Encoding::EXTERNAL, Encoding::INTERNAL$B$+$i$NN`?d$G(BEncoding::LOCALE$B$rA0$K(B
|$BF~$l$F$b$i$C$?$s$G$9$,!"A0<T(B2$B$D$r:o$k$H!"(BLOCALE$B$b:o$C$?J}$,$h$$$G$9$+(B?

locale$B$OJQ$o$i$J$$$s$G;D$7$F$b$h$$$s$G$9$,!"$I$&$7$^$7$g$&$M(B
$B$(!#N`?d85$,$J$/$J$C$?$s$G:o$k$N$,6Z$+$b$7$l$^$;$s$,!#(B
1e7e007723cfe59320d994a7db4ab4cf?d=identicon&s=25 Yugui (Yuki Sonoda) (Guest)
on 2008-12-12 14:13
(Received via mailing list)
Yuguiです。

Yukihiro Matsumoto さんは書きました:
> |* 
エンコーディングのデフォルトをRubyレベルで変更できるべきか?
> |  YES => setterメソッド追加で解決
> |  NO => IRB.parse_optsの拡張ライブラリ化で解決
>
> YES。リリースマネジメント的に許されるのであればsetterメソッド
> の追加が良いのでは。

そう言うわけで、default_externalとdefault_internalはユーザーの責任でRuby
レベルから設定できるようになりました。
これを使って、IRBの多言語化、全部ひっくるめてこんな感じの修正ではどうで
しょうか?
97f338629741aa42d6717bfba0c2830f?d=identicon&s=25 keiju ISHITSUKA (Guest)
on 2008-12-15 06:49
(Received via mailing list)
$B$1$$$8$e!w$$$7$D$+$G$9(B.

In [ruby-dev :37405 ] the message: "[ruby-dev:37405] Re: m17n of irb
", on Dec/12 22:05(JST) "Yugui (Yuki Sonoda)" writes:

>Yugui$B$G$9!#(B
>
>$B$=$&8@$&$o$1$G!"(Bdefault_external$B$H(Bdefault_internal$B$O%f!<%6!<$N@UG$$G(BRuby
>$B%l%Y%k$+$i@_Dj$G$-$k$h$&$K$J$j$^$7$?!#(B
>$B$3$l$r;H$C$F!"(BIRB$B$NB?8@8l2=!"A4It$R$C$/$k$a$F$3$s$J46$8$N=$@5$G$O$I$&$G(B
>$B$7$g$&$+(B?

$B$o$6$o$6$"$j$,$H$&$4$6$$$^$9(B.

$B%A%'%C%/%$%s$7$F$$$?$@$1$l$P$"$j$,$?$$$G$9(B.


__
---------------------------------------------------->> $B@PDM(B
$B7=<y(B <<---
---------------------------------->> e-mail: keiju@ishitsuka.com <<---
1e7e007723cfe59320d994a7db4ab4cf?d=identicon&s=25 Yugui (Yuki Sonoda) (Guest)
on 2008-12-18 03:14
(Received via mailing list)
Yugui (Yuki Sonoda) $B$5$s$O=q$-$^$7$?(B:
> Yugui$B$G$9!#(B
> 
$B$=$&8@$&$o$1$G!"(Bdefault_external$B$H(Bdefault_internal$B$O%f!<%6!<$N@UG$$G(BRuby
> $B%l%Y%k$+$i@_Dj$G$-$k$h$&$K$J$j$^$7$?!#(B
> $B$3$l$r;H$C$F!"(BIRB$B$NB?8@8l2=!"A4It$R$C$/$k$a$F$3$s$J46$8$N=$@5$G$O$I$&$G(B
> $B$7$g$&$+(B?

$BFC$K0[O@$,$J$1$l$P:#F|$"$?$j$3$s$J46$8$G%3%_%C%H$7$h$&$H;W$$$^$9!#(B
97f338629741aa42d6717bfba0c2830f?d=identicon&s=25 石塚圭樹 (Guest)
on 2008-12-18 05:16
(Received via mailing list)
$B$1$$$8$e!w$$$7$D$+$G$9(B.

In [ruby-dev :37487 ] the message: "[ruby-dev:37487] Re: m17n of irb
", on Dec/18 11:05(JST) "Yugui (Yuki Sonoda)" writes:

>> 
$B$=$&8@$&$o$1$G!"(Bdefault_external$B$H(Bdefault_internal$B$O%f!<%6!<$N@UG$$G(BRuby
>> $B%l%Y%k$+$i@_Dj$G$-$k$h$&$K$J$j$^$7$?!#(B
>> $B$3$l$r;H$C$F!"(BIRB$B$NB?8@8l2=!"A4It$R$C$/$k$a$F$3$s$J46$8$N=$@5$G$O$I$&$G(B
>> $B$7$g$&$+(B?
>
>$BFC$K0[O@$,$J$1$l$P:#F|$"$?$j$3$s$J46$8$G%3%_%C%H$7$h$&$H;W$$$^$9!#(B

$B$"$l(B? $BJV;v$7$?$D$b$j$J$s$G$9$,(B... [ruby-dev:37441]

$B%3%_%C%H$h$m$7$/$*4j$$$$$?$7$^$9(B.

__
---------------------------------------------------->> $B@PDM(B
$B7=<y(B <<---
---------------------------------->> e-mail: keiju@ishitsuka.com <<---
7f19d1a3818a0a0c2f59ecba589bbf6b?d=identicon&s=25 Vincent Isambart (Guest)
on 2008-12-20 00:53
(Received via mailing list)
$B%P%s%5%s$G$9!#(B

M17N$B$5$l$?(BIRB$B$O!"(BLANG=ja_JP.utf8$B$G$J$$>l9g!"%(%i!<$,H/@8$5$l$^$9!'(B
~% irb-1.9
/usr/local/lib/ruby-1.9/1.9.1/irb/locale.rb:126:in `load': No such
file to load -- irb/encoding_aliases.rb (LoadError)
  from /usr/local/lib/ruby-1.9/1.9.1/irb/locale.rb:37:in `initialize'
  from /usr/local/lib/ruby-1.9/1.9.1/irb/init.rb:114:in `new'
  from /usr/local/lib/ruby-1.9/1.9.1/irb/init.rb:114:in `init_config'
  from /usr/local/lib/ruby-1.9/1.9.1/irb/init.rb:16:in `setup'
  from /usr/local/lib/ruby-1.9/1.9.1/irb.rb:53:in `start'
  from /usr/local/bin/irb-1.9:12:in `<main>'

~% export LANG=ja_JP.utf-8
~% irb-1.9
irb(main):001:0>
1e7e007723cfe59320d994a7db4ab4cf?d=identicon&s=25 Yugui (Yuki Sonoda) (Guest)
on 2008-12-20 03:04
(Received via mailing list)
Yugui$B$G$9!#(B

On 12/20/08 8:44 AM, Vincent Isambart wrote:
> M17N$B$5$l$?(BIRB$B$O!"(BLANG=ja_JP.utf8$B$G$J$$>l9g!"%(%i!<$,H/@8$5$l$^$9!'(B

$B$9$_$^$;$s!#(Btypo$B$G$7$?!#(B
r20889$B$GD>$C$?$+$H;W$$$^$9!#(B
This topic is locked and can not be replied to.