こんにちは、kouya です。 strscanのリファレンスマニュアルを書いています。 添付したサンプルがruby 1.9 では動かないのですが、 1.9では何か変更する必要があるのでしょうか。 よろしくお願いします。 サンプル require 'strscan' $KCODE = "e" s = StringScanner.new("るびい") # 文字コードはEUC-JPとします $KCODE = 'n' # 単なるバイト列として認識されます p s.getch # => "\244" p s.getch # => "\353" $KCODE = "e" # EUC-JPの文字列として認識されます