2007年10月28日 星期日 11:03
a> ÅöÉÏÈ«½Ç/°ë½ÇÕâÖÖ¶«Î÷£¬ÓÐûÓÐʲôӰÏì¡££¨ÆäʵÎÒ¶ÔÈ«½Ç/°ë½ÇÒ²²»ÊǺÜÃ÷°×£¬Ö»ÊǾõµÃ¿ÉÄÜ»áÓÐÓ°Ï죬ÓÐË˳±ã½²½²È«½Ç/°ë½Ç£¿£¿£© b> ÔõôÑù²ÅÄÜÕýȷʶ±ðÒ»¾ä»°¡£Ð§¹û¾ÍÏñÒ»¸öÈËÔÚ¶ÁÎÄÕÂʱµÄÄÇÖָоõ¡£ c> .... ÓÐË×ö¹ýÀàËƵĶ«Î÷Âð£¿Äܲ»ÄÜÖ¸µãÏÂ...( ~__~ ) -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20071028/88766ae2/attachment.html
2007年10月28日 星期日 11:19
ÓÐûÓа취¿ÉÒԵõ½Ä³ÖÖ±àÂëµÄËùÓбêµã·ûºÅµÄ¼¯ºÏ£¿£¿£¿£¿ ÔÚ07-10-28£¬??? ?? <clfff.peter在gmail.com> дµÀ£º > > > a> ÅöÉÏÈ«½Ç/°ë½ÇÕâÖÖ¶«Î÷£¬ÓÐûÓÐʲôӰÏì¡££¨ÆäʵÎÒ¶ÔÈ«½Ç/°ë½ÇÒ²²»ÊǺÜÃ÷°×£¬Ö»ÊǾõµÃ¿ÉÄÜ»áÓÐÓ°Ï죬ÓÐË˳±ã½²½²È«½Ç/°ë½Ç£¿£¿£© > b> ÔõôÑù²ÅÄÜÕýȷʶ±ðÒ»¾ä»°¡£Ð§¹û¾ÍÏñÒ»¸öÈËÔÚ¶ÁÎÄÕÂʱµÄÄÇÖָоõ¡£ > c> .... > ÓÐË×ö¹ýÀàËƵĶ«Î÷Âð£¿Äܲ»ÄÜÖ¸µãÏÂ...( ~__~ ) > -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20071028/64bfb5b7/attachment.htm
2007年10月28日 星期日 13:20
给你提示下 #!/usr/bin/python # -*- coding: UTF-8 -*- def zh2unicode(stri): """Auto converter encodings to unicode It will test utf8,gbk,big5,jp,kr to converter""" global encc for c in ('utf-8', 'gbk', 'big5', 'jp', 'euc_kr','utf16','utf32'): encc = c try: return stri.decode(c) except: pass encc = 'unk' return stri seps=[" ","\t","\n","\r",",","<",">","?","!", ";","\#",":",".","'",'"',"(",")","{","}","[","]","|","_","=", " ",",","?","。","、",""",""","《","》","[","]","!","(",")"] seps=map(lambda i:unicode(i,'utf8'), seps)
2007年10月28日 星期日 17:35
这种方法是不完备的,有可能一种编码的字节流刚好在另一种编码中也是有效的,但是内容不对 On 10/28/07, Jiahua Huang <jhuangjiahua在gmail.com> wrote: > > 给你提示下 > > > #!/usr/bin/python > # -*- coding: UTF-8 -*- > > def zh2unicode(stri): > """Auto converter encodings to unicode > > It will test utf8,gbk,big5,jp,kr to converter""" > global encc > for c in ('utf-8', 'gbk', 'big5', 'jp', 'euc_kr','utf16','utf32'): > encc = c > try: > return stri.decode(c) > except: > pass > encc = 'unk' > return stri > > seps=[" ","\t","\n","\r",",","<",">","?","!", > ";","\#",":",".","'",'"',"(",")","{","}","[","]","|","_","=", > " ",",","?","。","、",""",""","《","》","[","]","!","(",")"] > > seps=map(lambda i:unicode(i,'utf8'), seps) > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese -------------- 下一部分 -------------- 一个HTML附件被移除... URL: http://python.cn/pipermail/python-chinese/attachments/20071028/c48776a5/attachment.htm
2007年10月29日 星期一 16:24
ÏÈÊÔÊÔ°É£¬Ð»Ð»¡£ 2007/10/28, Jiahua Huang <jhuangjiahua在gmail.com>: > > ¸øÄãÌáʾÏ > > > #!/usr/bin/python > # -*- coding: UTF-8 -*- > > def zh2unicode(stri): > """Auto converter encodings to unicode > > It will test utf8,gbk,big5,jp,kr to converter""" > global encc > for c in ('utf-8', 'gbk', 'big5', 'jp', 'euc_kr','utf16','utf32'): > encc = c > try: > return stri.decode(c) > except: > pass > encc = 'unk' > return stri > > seps=[" ","\t","\n","\r",",","<",">","?","!", > ";","\#",":",".","'",'"',"(",")","{","}","[","]","|","_","=", > " ","£¬","£¿","¡£","¡¢",""",""","¡¶","¡·","£Û","£Ý","£¡","£¨","£©"] > > seps=map(lambda i:unicode(i,'utf8'), seps) > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20071029/c26c7646/attachment.html
Zeuux © 2025
京ICP备05028076号