Python编程:从入门到实践电子书下载
Python2ÖбàÂëÏà¹ØµÄÎÊÌâºÜÊÇÈÃÈ˵°ÌÛ£¬ÌرðÊÇÖÐÎÄ×Ö·û¡£
±ÈÈç±¾ÎÄËùÊöµÄÖÐÎÄÍøÒ³GBK±àÂëµÄ¹îÒìÎÊÌâ¡£
ÏÖÏó
ÀýÈ磺会员£¬ÆäʵÍøÒ³ÀïÃæÕý³£µÄÓ¦¸ÃÊÇ»áÔ±
·ÖÎö
½Ó×ÅÉÏÃæµÄÀý×Ó£¬»áÔ±Õⲿ·ÖÂÒÂëͨ¹ýrepr()º¯ÊýÇóÖµµÃµ½ÈçϽá¹û
\xc3\xa4\xc2\xbc\xc2\x9a\xc3\xa5\xc2\x91\xc2\x98
ʹÓÃtype()º¯ÊýÇóÖµµÃµ½µÄ½á¹ûΪunicode
eval(repr())³öÀ´ÖµÎª
会员
ͨ¹ý²é±íÉÏÊö6¸öºº×Ö¶ÔÓ¦
c3a4 c2bc c29a c3a5 c291 c298
¶øÉÏÃæÄÚÈݶÔÓ¦µÄUTF-8Öµ¾ÍÊÇ»áÔ±
½â¾ö·½·¨
Ï൱¹îÒìµÄÊDZ¾ÉíÊÇunicode±àÂ룬ȴ±»µ±×÷GBKϵÁÐÀ´½âÂ룬½á¹ûµ¼ÖÂÂÒÂë¡£Òò´Ë½«ÕâЩ×Ö·ûÏȱàÂëÔÙ½â¾ö½â¾öÎÊÌâ¡£
encode('raw_unicode_escape').decode()
ÒÔÉÏÕâƪdz̸Python2Ö®ºº×Ö±àÂëΪunicodeµÄÎÊÌâ(¼´ÀàËÆ\xc3\xa4)¾ÍÊÇС±à·ÖÏí¸ø´ó¼ÒµÄÈ«²¿ÄÚÈÝÁË£¬Ï£ÍûÄܸø´ó¼ÒÒ»¸ö²Î¿¼£¬Ò²Ï£Íû´ó¼Ò¶à¶àÖ§³Ö½Å±¾Ö®¼Ò¡£