일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- web
- Book
- agile
- Python
- erlang
- RFID
- ubuntu
- leadership
- Java
- management
- Italy
- Spain
- essay
- France
- Kuala Lumpur
- Book review
- QT
- hbase
- history
- MySQL
- Linux
- program
- programming_book
- Software Engineering
- comic agile
- Programming
- django
- hadoop
- Malaysia
- Artificial Intelligence
- 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..