IronRuby

IronRuby 1.0における日本語コード変換

IronRuby 1.0ではmodule NKFのModule Functionsが定義されておらず、NKFモジュールおよびKconvモジュールの各機能が使えません。 そこでWindows版のnkfを使ってNKFモジュールおよびKconvモジュールの主要な機能が使えるようにする方法を考えてみました。 1…

IronRubyのString#bytesizeが定義されていない

IronRubyのString#bytesizeが定義されていません。 具体的にはIronRuby Consoleで >>> "abc".bytesize (ir):1: undefined method `bytesize' for "abc":String (NoMethodError) この様になります。 対処としては class String def bytesize self.GetByteCoun…

IronRuby上のRSpecで日本語が文字化け

IronRuby 1.0.0.0 とRSpec 1.3.0の組み合わせでテスト記述にShift_JISを使うと文字化けします。 具体的には describe Array, "emptyの場合" do before do @empty_array = [] end it "emptyであること" do @empty_array.should be_empty end it "sizeが0であ…