일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- programming_book
- web
- Linux
- Book review
- management and leadership
- UK
- history
- agile
- MySQL
- hbase
- RFID
- comic agile
- leadership
- France
- erlang
- Book
- Italy
- management
- program
- Malaysia
- hadoop
- Programming
- Kuala Lumpur
- Spain
- Java
- django
- Python
- QT
- Software Engineering
- ubuntu
- Today
- Total
목록Unicode (2)
상황; 유니코드 한글만 pattern matching으로 찾고 싶은 경우unicode table; http://jrgraphix.net/r/Unicode/AC00-D7AF>>> print unichr(int('AC00', 16)) 가 >>> print unichr(int('D7A3', 16)) 힣 >>> korPattern = re.compile(u'[\uAC00-\uD7A3]+', re.U) >>> t = u'[[프랑스]] [[파리 (프랑스)|파리]]' >>> for m in re.finditer(korPattern, t): print m.group() ... 프랑스 파리 프랑스 파리utf-8>>> korPattern = re.compile('([\xE0-\xFF][\x80-\xFF][\x80-\xFF..
http://docs.python.org/2/howto/unicode.html e.g. UnicodeEncodeError: 'ascii' codec can't encode character u'\ua000' in position 0: ordinal not in range(128)MySQLdb로 mysql의 table에서 select를 해 file에 저장할 때str = '....'try:str = str.encode('utf-8')except UnicodeDecodeError:str = str.encode('ascii')e.g. UnicodeDecodeError: 'ascii' codec can't decode byte 0x9f in position 3: ordinal not in range(128) ht..