Error: ASCII 'ascii' codec can't encode character u'\xb5'

1239
3
03-05-2022 11:44 AM
H__DanielRamos_Mendoza
New Contributor III

When viewing the data it shows me the error in python - arcpy

H__DanielRamos_Mendoza_0-1646509402114.png

 

H__DanielRamos_Mendoza_0-1646509312884.png

 

Tags (1)
0 Kudos
3 Replies
DanPatterson
MVP Esteemed Contributor

encoding should be utf-8.  It is the default for python 3.x and arcgis Pro as well


... sort of retired...
0 Kudos
H__DanielRamos_Mendoza
New Contributor III

I am using python 2.7

0 Kudos
KimGarbade
Occasional Contributor III

I found a discussion on this topic on Stackoverflow, where someone else had the same problem. 

I'm posting a link to the python docs thy post references below. I didn't want to paste a link to the post itself (I know people have security concerns) so I'm pasting images below that get to the "good parts" of the post.  The first is a description of the problem, the second the suggested solution:

Issue from link:

KimGarbade_0-1646572060459.png

Solution from link:

KimGarbade_1-1646572227108.png

Python docs: 

https://docs.python.org/2.7/howto/unicode.html

0 Kudos