Select to view content in your preferred language

Help for error encoding esri

851
1
01-11-2012 12:30 AM
khalidoube
Emerging Contributor
Hello;
I have a problem with running arctoolbox running, this arctoolbox is bases of an script who i created for convert shape to sde . But, when i run this, i have this error
ascii cant encode xa0.
what line python can i make in script for sove this error of encodage

Bests regards
Tags (2)
0 Kudos
1 Reply
AndrewChapkowski
Esri Regular Contributor
Check your field values to ensure that there are no ascii values, you can use the encode() method to remove values that will cause your script to fail.
Example:
value = sRow.getValue(field.name).encode('ascii','ignore')

All ascii values will be ignored.  You can also replace the values.

See http://docs.python.org/library/stdtypes.html for more information.
0 Kudos