fork(1) download
  1. # -*- coding: shift_jis -*-
  2.  
  3. id="ももち"
  4. p id.encoding
  5. p id.codepoints{|cp| print cp.to_s(16) + " " }
  6.  
  7. ec = Encoding::Converter.new("shift_jis", "UTF-8")
  8. dst = ec.convert(id)
  9.  
  10.  
  11. p dst
  12. p dst.encoding
  13. p dst.codepoints{|cp| print cp.to_s(16) + " " }
  14.  
Success #stdin #stdout 0.01s 7600KB
stdin
Standard input is empty
stdout
#<Encoding:Shift_JIS>
e382 82e3 8282 e381 a1 "\x{E382}\x{82E3}\x{8282}\x{E381}\xA1"
"繧ゅb縺。"
#<Encoding:UTF-8>
7e67 3085 ff42 7e3a ff61 "繧ゅb縺。"