So I have a spreadsheet that I'm trying to import into a GDB as a shapefile and then modify some fields with arcpy.AlterField_management(). The problem is that the field name has an accent mark (Dirección), and PyScripter says it can't find that field, even if I put # -- coding: utf-8 -- at the beginning of the script. I know the problem is the accent mark, because if I manually remove the accent mark in the original excel file, the script runs with no errors, but as soon as it has the accent mark, it says it can't find that field. Removing it manually is not an option because I want to use this for spreadsheets that have many accent marks and it would take forever to remove all of them manually. I already tried writing utf-8 at the beginning of the script and it still doesn't work and I don't know why. Do you know how can I solve this problem?
This is the line that gets the error:
arcpy.AlterField_management("Tabla", "Dirección", "STNAME", "STNAME")