Tell me more ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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:

  1. Create a text field in an attribute table
  2. Field calculate that field with the unicode value, so u00e9
  3. 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

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.