Possible Unicode Error?  Field Calculator Help!!

982
2
Jump to solution
03-05-2014 04:39 AM
MaryM
by
Occasional Contributor
I am getting funny symbols when I do a simple field calculate on a unicode field in a file geodatabase. 

I do this:

arcpy.CalculateField_management(outFileThree, "HOTLINK", "!HOTLINK!.lower()", "PYTHON_9.3", "")

and get funny little L or upside down Ls in the field where there were \ characters or \0s.

How do I field calculate correctly field calculate and why is this happening?
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
MaryM
by
Occasional Contributor
After several days of trying and finally posting and then I just figured it out...

arcpy.CalculateField_management(lyr, "TestHotlink","r!HOTLINK!.lower()", "PYTHON_9.3", "")

I kept trying things like r(!HOTLINK!) which did not work.

View solution in original post

0 Kudos
2 Replies
JoshuaChisholm
Occasional Contributor III
I think it's not working because python sees / as an escape character. It turns /0 into a special character (that's show up odd in your attribute table). I couldn't find an easy and functional solution.

As much as I hate to say so, the easiest fix might be to just use vb script instead of python:
arcpy.CalculateField_management(outFileThree, "HOTLINK", "LCase( [HOTLINK] )", "VB", "")


Let me know how it goes!
0 Kudos
MaryM
by
Occasional Contributor
After several days of trying and finally posting and then I just figured it out...

arcpy.CalculateField_management(lyr, "TestHotlink","r!HOTLINK!.lower()", "PYTHON_9.3", "")

I kept trying things like r(!HOTLINK!) which did not work.
0 Kudos