2007年07月04日 星期三 09:03
×î½üдÁËÒ»¸öС³ÌÐò£¬Óõ½ÁË MySQLdb £¬µ±ÔÚ¶ÁÈ¡ÖÐÎĵÄʱºò×ÜÊdzöÏÖ \xe5\x85\xb6\xe5\xae\x83 ÕâÑùÀàËÆµÄ×Ö·û£¬ÍøÉÏËÑË÷Ðí¾Ã£¬Î´¹û¡£¿ÏÇëÄÄλ¸ßÈËÖ¸µãһϡ£ ¸ÐлÍò·Ö¡£¡£¡£ -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070704/991a9fb4/attachment.html
2007年07月04日 星期三 09:09
>>> string='\xe5\x85\xb6\xe5\xae\x83'
>>> print string.decode('utf-8')
其它
On 7/4/07, jcold <jcoldyu at gmail.com> wrote:
>
> 最近写了一个小程序,用到了 MySQLdb ,当在读取中文的时候总是出现
> \xe5\x85\xb6\xe5\xae\x83
> 这样类似的字符,网上搜索许久,未果。肯请哪位高人指点一下。
> 感谢万分。。。
>
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
--
http://codeplayer.blogspot.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://python.cn/pipermail/python-chinese/attachments/20070704/b84dbdf2/attachment.html
2007年07月04日 星期三 09:12
²»´í£¬³É¹¦ÁË¡£¶àл¡£ -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070704/01cb2950/attachment.htm
2007年07月04日 星期三 09:58
为什么我查出来就直接显示中文了,是不是连接后没有执行SET NAMES UTF8的原因?
黄毅 写道:
> >>> string='\xe5\x85\xb6\xe5\xae\x83'
> >>> print string.decode('utf-8')
> 其它
>
> On 7/4/07, *jcold* < jcoldyu在gmail.com jcoldyu在gmail.com>> wrote:
>
> 最近写了一个小程序,用到了 MySQLdb ,当在读取中文的时候总是出现
> \xe5\x85\xb6\xe5\xae\x83
> 这样类似的字符,网上搜索许久,未果。肯请哪位高人指点一下。
> 感谢万分。。。
>
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> python-chinese在lists.python.cn>
> Subscribe: send subscribe to
> python-chinese-request在lists.python.cn
> python-chinese-request在lists.python.cn>
> Unsubscribe: send unsubscribe to
> python-chinese-request在lists.python.cn
> python-chinese-request在lists.python.cn>
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
>
>
>
> --
> http://codeplayer.blogspot.com/
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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
2007年07月04日 星期三 10:28
On 7/4/07, Ahdong <ahdong在126.com> wrote: > > ΪʲôÎÒ²é³öÀ´¾ÍÖ±½ÓÏÔʾÖÐÎÄÁË£¬ÊDz»ÊÇÁ¬½ÓºóûÓÐÖ´ÐÐSET NAMES UTF8µÄÔÒò£¿ »¹ÊÇÒª°ÑÄãÓõĻ·¾³ËµÇå³þ¡£ÊÇÔÚBSD/LinuxϵÄx term ÖÐÓÃmysql ÃüÁîÐУ¬»¹ÊDZðµÄʲô£¿ -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070704/4e6c2605/attachment.html
2007年07月04日 星期三 11:15
лл´ó¼ÒµÄÈÈÐİïÖú¡£
ÎÊÌâÒѾ½â¾ö¡£
>>> string='\xe5\x85\xb6\xe5\xae\x83'
> >>> print string.decode('utf-8')
> ÆäËü
>
ÒÔÉÏÊǽâ¾ö·½·¨£¬»ÆÒãÐÖµÜÌṩ¡£
ÎҵĻ·¾³ÊÇ£ºWindows Server 2003 + Python 2.5.1c1 + MySQL Server 5.0
Ï£ÍûÒÔºóÓöµ½´ËÀàÎÊÌâµÄͬÐпÉÒԲο¼¡£
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20070704/a74f1703/attachment.html
Zeuux © 2025
京ICP备05028076号