M17N Example STDIN.encodng = "EUC-JP;UTF-8" line = STDIN.gets p line.encoding # => "UTF-8" print line.encode("Shift_JIS")