UnicodeEncodeError: 'ascii' codec can't encode character u'\xef' in position 0: ordinal not in range(128)

前端 未结 7 1586
旧巷少年郎
旧巷少年郎 2020-11-28 04:24

I want to parse my XML document. So I have stored my XML document as below

class XMLdocs(db.Expando):  
   id = db.IntegerProperty()    
   name=db.StringPro         


        
7条回答
  •  悲哀的现实
    2020-11-28 04:50

    The problem is that you're trying to print an unicode character to a possibly non-unicode terminal. You need to encode it with the 'replace option before printing it, e.g. print ch.encode(sys.stdout.encoding, 'replace').

提交回复
热议问题