Skip to content

Instantly share code, notes, and snippets.

@miyagawa
Created March 27, 2012 04:40
Show Gist options
  • Star 50 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miyagawa/2212589 to your computer and use it in GitHub Desktop.
Save miyagawa/2212589 to your computer and use it in GitHub Desktop.
> perl -E 'say "生" & "死"'
生 Life U+751F \xe7\x94\x9f 11100111 10010100 10011111
死 Death U+6B7B \xe6\xad\xbb 11100110 10101101 10111011
愛 Love u+611B \xe6\x84\x9b 11100110 10000100 10011011
@noodles-v6
Copy link

I got 衫

@shmuelfomberg
Copy link

noodles-v6: here is a list of encodings that will give you this results:
(the binary representation if in order of qw{生 死 衫})
So your command line is probably assuming on of these.

found for encoding cp936: 1100100111111010, 1100101111000000, 1100100111000000
found for encoding euc-cn: 1100100111111010, 1100101111000000, 1100100111000000
found for encoding gb12345-raw: 0100100101111010, 0100101101000000, 0100100101000000
found for encoding gb2312-raw: 0100100101111010, 0100101101000000, 0100100101000000
found for encoding hz: 011111100111101101001001011110100111111001111101, 011111100111101101001011010000000111111001111101, 011111100111101101001001010000000111111001111101
found for encoding iso-ir-165: 0100100101111010, 0100101101000000, 0100100101000000
found for encoding MacChineseSimp: 1100100111111010, 1100101111000000, 1100100111000000

@noodles-v6
Copy link

@semuel
I understand it. is there a tool for encoding and decoding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment