I'm playing with unicode values in ArcGIS. Basically, I am trying to set a field that will store unicode values. I found this scripting example to encode unicode values.
import locale
locale.getdefaultlocale()
print u'Libert\u00e9'
This returns:
Liberté
With the accented é at the end
In my infinite wisdom, based on a very rookie experience with unicode encoding in python, I figured I could do this:
- Create a text field in an attribute table
- Field calculate that field with the unicode value, so u00e9
Define a python labeling expression like follows:
def FindLabel ( [Unicode] ): import locale locale.getdefaultlocale() return u'Libert\ + [Unicode] + "'"
This isn't working and I've played around with the return statement a bit, but I can't seem to get it to work....or really know if what I'm trying to do should work.
Basically, if I do get it to work, I want to store unicode in a field in an attribute table, so I can build label expressions from it. I may even go further and tru to set up domain codes for the unicode values.
But then again, maybe I am way out to lunch on what I'm trying to attempt here.
Any suggestions are welcome! Mike
