reference: http://stackoverflow.com/questions/7291120/python-and-unicode-code-point-extraction
#python3
for i in range(1,100000): # try range(44032,55203) for Korean
print(i, chr(i), repr(chr(i)), repr(chr(i).encode('utf8')))
if i%30==0:
input("Enter to continue")
#python3
for i in range(1,100000): # try range(44032,55203) for Korean
print(i, chr(i), repr(chr(i)), repr(chr(i).encode('utf8')))
if i%30==0:
input("Enter to continue")
#python2
for i in range(1,100000):
print i, unichr(i), repr(unichr(i)), repr(unichr(i).encode('utf8'))
if i%30==0:
raw_input("Enter to continue")
#result
1 u'\x01' '\x01'
2 u'\x02' '\x02'
3 u'\x03' '\x03'
4 u'\x04' '\x04'
5 u'\x05' '\x05'
6 u'\x06' '\x06'
7 u'\x07' '\x07'
8 u'\x08' '\x08'
...snipped...
241 ñ u'\xf1' '\xc3\xb1'
242 ò u'\xf2' '\xc3\xb2'
243 ó u'\xf3' '\xc3\xb3'
244 ô u'\xf4' '\xc3\xb4'
245 õ u'\xf5' '\xc3\xb5'
246 ö u'\xf6' '\xc3\xb6'
247 ÷ u'\xf7' '\xc3\xb7'
248 ø u'\xf8' '\xc3\xb8'
249 ù u'\xf9' '\xc3\xb9'
250 ú u'\xfa' '\xc3\xba'
251 û u'\xfb' '\xc3\xbb'
252 ü u'\xfc' '\xc3\xbc'
253 ý u'\xfd' '\xc3\xbd'
254 þ u'\xfe' '\xc3\xbe'
255 ÿ u'\xff' '\xc3\xbf'
256 Ā u'\u0100' '\xc4\x80'
257 ā u'\u0101' '\xc4\x81'
258 Ă u'\u0102' '\xc4\x82'
...snipped...
44032 가 u'\uac00' '\xea\xb0\x80'
44033 각 u'\uac01' '\xea\xb0\x81'
44034 갂 u'\uac02' '\xea\xb0\x82'
44035 갃 u'\uac03' '\xea\xb0\x83'
44036 간 u'\uac04' '\xea\xb0\x84'
44037 갅 u'\uac05' '\xea\xb0\x85'
44038 갆 u'\uac06' '\xea\xb0\x86'
44039 갇 u'\uac07' '\xea\xb0\x87'
44040 갈 u'\uac08' '\xea\xb0\x88'
...snipped...
댓글
댓글 쓰기