require 'jcode' a = "私は236番目に馬鹿です。" $KCODE = "EUC" puts a.jsize
require "kconv" text = "あいう" text = Kconv::toeuc(text)