简体   繁体   English

Python Unicode编码错误

[英]Python Unicode Encode Error

I'm reading and parsing an Amazon XML file and while the XML file shows a ' , when I try to print it I get the following error:我正在读取和解析Amazon XML文件,并且当XML文件显示'时,当我尝试打印它时,出现以下错误:

'ascii' codec can't encode character u'\u2019' in position 16: ordinal not in range(128) 

From what I've read online thus far, the error is coming from the fact that the XML file is in UTF-8, but Python wants to handle it as an ASCII encoded character.从到目前为止的在线阅读中,该错误是由于XML文件位于UTF-8中引起的,但是Python希望将其作为ASCII编码字符来处理。 Is there a simple way to make the error go away and have my program print the XML as it reads?有没有一种简单的方法可以使错误消失并让我的程序在读取时打印XML?

I'm reading and parsing an Amazon XML file and while the XML file shows a ' , when I try to print it I get the following error:我正在读取和解析Amazon XML文件,并且当XML文件显示'时,当我尝试打印它时,出现以下错误:

'ascii' codec can't encode character u'\u2019' in position 16: ordinal not in range(128) 

From what I've read online thus far, the error is coming from the fact that the XML file is in UTF-8, but Python wants to handle it as an ASCII encoded character.从到目前为止的在线阅读中,该错误是由于XML文件位于UTF-8中引起的,但是Python希望将其作为ASCII编码字符来处理。 Is there a simple way to make the error go away and have my program print the XML as it reads?有没有一种简单的方法可以使错误消失并让我的程序在读取时打印XML?

I'm reading and parsing an Amazon XML file and while the XML file shows a ' , when I try to print it I get the following error:我正在读取和解析Amazon XML文件,并且当XML文件显示'时,当我尝试打印它时,出现以下错误:

'ascii' codec can't encode character u'\u2019' in position 16: ordinal not in range(128) 

From what I've read online thus far, the error is coming from the fact that the XML file is in UTF-8, but Python wants to handle it as an ASCII encoded character.从到目前为止的在线阅读中,该错误是由于XML文件位于UTF-8中引起的,但是Python希望将其作为ASCII编码字符来处理。 Is there a simple way to make the error go away and have my program print the XML as it reads?有没有一种简单的方法可以使错误消失并让我的程序在读取时打印XML?

I'm reading and parsing an Amazon XML file and while the XML file shows a ' , when I try to print it I get the following error:我正在读取和解析Amazon XML文件,并且当XML文件显示'时,当我尝试打印它时,出现以下错误:

'ascii' codec can't encode character u'\u2019' in position 16: ordinal not in range(128) 

From what I've read online thus far, the error is coming from the fact that the XML file is in UTF-8, but Python wants to handle it as an ASCII encoded character.从到目前为止的在线阅读中,该错误是由于XML文件位于UTF-8中引起的,但是Python希望将其作为ASCII编码字符来处理。 Is there a simple way to make the error go away and have my program print the XML as it reads?有没有一种简单的方法可以使错误消失并让我的程序在读取时打印XML?

I'm reading and parsing an Amazon XML file and while the XML file shows a ' , when I try to print it I get the following error:我正在读取和解析Amazon XML文件,并且当XML文件显示'时,当我尝试打印它时,出现以下错误:

'ascii' codec can't encode character u'\u2019' in position 16: ordinal not in range(128) 

From what I've read online thus far, the error is coming from the fact that the XML file is in UTF-8, but Python wants to handle it as an ASCII encoded character.从到目前为止的在线阅读中,该错误是由于XML文件位于UTF-8中引起的,但是Python希望将其作为ASCII编码字符来处理。 Is there a simple way to make the error go away and have my program print the XML as it reads?有没有一种简单的方法可以使错误消失并让我的程序在读取时打印XML?

I'm reading and parsing an Amazon XML file and while the XML file shows a ' , when I try to print it I get the following error:我正在读取和解析Amazon XML文件,并且当XML文件显示'时,当我尝试打印它时,出现以下错误:

'ascii' codec can't encode character u'\u2019' in position 16: ordinal not in range(128) 

From what I've read online thus far, the error is coming from the fact that the XML file is in UTF-8, but Python wants to handle it as an ASCII encoded character.从到目前为止的在线阅读中,该错误是由于XML文件位于UTF-8中引起的,但是Python希望将其作为ASCII编码字符来处理。 Is there a simple way to make the error go away and have my program print the XML as it reads?有没有一种简单的方法可以使错误消失并让我的程序在读取时打印XML?

I'm reading and parsing an Amazon XML file and while the XML file shows a ' , when I try to print it I get the following error:我正在读取和解析Amazon XML文件,并且当XML文件显示'时,当我尝试打印它时,出现以下错误:

'ascii' codec can't encode character u'\u2019' in position 16: ordinal not in range(128) 

From what I've read online thus far, the error is coming from the fact that the XML file is in UTF-8, but Python wants to handle it as an ASCII encoded character.从到目前为止的在线阅读中,该错误是由于XML文件位于UTF-8中引起的,但是Python希望将其作为ASCII编码字符来处理。 Is there a simple way to make the error go away and have my program print the XML as it reads?有没有一种简单的方法可以使错误消失并让我的程序在读取时打印XML?

I'm reading and parsing an Amazon XML file and while the XML file shows a ' , when I try to print it I get the following error:我正在读取和解析Amazon XML文件,并且当XML文件显示'时,当我尝试打印它时,出现以下错误:

'ascii' codec can't encode character u'\u2019' in position 16: ordinal not in range(128) 

From what I've read online thus far, the error is coming from the fact that the XML file is in UTF-8, but Python wants to handle it as an ASCII encoded character.从到目前为止的在线阅读中,该错误是由于XML文件位于UTF-8中引起的,但是Python希望将其作为ASCII编码字符来处理。 Is there a simple way to make the error go away and have my program print the XML as it reads?有没有一种简单的方法可以使错误消失并让我的程序在读取时打印XML?

I'm reading and parsing an Amazon XML file and while the XML file shows a ' , when I try to print it I get the following error:我正在读取和解析Amazon XML文件,并且当XML文件显示'时,当我尝试打印它时,出现以下错误:

'ascii' codec can't encode character u'\u2019' in position 16: ordinal not in range(128) 

From what I've read online thus far, the error is coming from the fact that the XML file is in UTF-8, but Python wants to handle it as an ASCII encoded character.从到目前为止的在线阅读中,该错误是由于XML文件位于UTF-8中引起的,但是Python希望将其作为ASCII编码字符来处理。 Is there a simple way to make the error go away and have my program print the XML as it reads?有没有一种简单的方法可以使错误消失并让我的程序在读取时打印XML?

I'm reading and parsing an Amazon XML file and while the XML file shows a ' , when I try to print it I get the following error:我正在读取和解析Amazon XML文件,并且当XML文件显示'时,当我尝试打印它时,出现以下错误:

'ascii' codec can't encode character u'\u2019' in position 16: ordinal not in range(128) 

From what I've read online thus far, the error is coming from the fact that the XML file is in UTF-8, but Python wants to handle it as an ASCII encoded character.从到目前为止的在线阅读中,该错误是由于XML文件位于UTF-8中引起的,但是Python希望将其作为ASCII编码字符来处理。 Is there a simple way to make the error go away and have my program print the XML as it reads?有没有一种简单的方法可以使错误消失并让我的程序在读取时打印XML?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM