Skip to content

Instantly share code, notes, and snippets.

@slightair
Created December 3, 2012 05:26
Show Gist options
  • Save slightair/4192942 to your computer and use it in GitHub Desktop.
Save slightair/4192942 to your computer and use it in GitHub Desktop.
ひろし
>> puts "ひろし".unpack("b*")[0].scan(/../).map{|x|%w(ヴ ィ ム …)[x.to_i(2)]}.join("")
…ヴィ…ムヴヴィィヴ…ィ…ヴィ…ィヴヴィム…ヴィ…ヴィ…ムヴヴィ…ムムィ
=> nil
>> puts ["…ヴィ…ムヴヴィィヴ…ィ…ヴィ…ィヴヴィム…ヴィ…ヴィ…ムヴヴィ…ムムィ".scan(/ヴ|ィ|ム|…/).map{|c|%w(ヴ ィ ム …).index(c)}.map{|i|"%02b"%i}.join("")].pack("b*")
ひろし
=> nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment