@kyanny's blog

My thoughts, my life. Views/opinions are my own.

自由研究

マルチバイト文字

#!/usr/bin/env ruby # coding: utf-8 # Shift_JIS (CP932) "あ".encode('cp932').ord # => 33440 "あ".encode('cp932').ord.to_s(16) # => "82a0" "あ".encode('cp932').codepoints.first.to_s(16) # => "82a0" a = "あ".encode('cp932').ord.to_s(2) # => …