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

`

pre-logic:
def myCalc(name,nameVal):
  if (name == nameVal):
    return 1
  else:
    return 0

var_name=
myCalc(!Epulettipus!,"Lakóépület")

`

This doesn't work with accentuated strings. (But works with unaccentuated strings). What can I do?

share|improve this question
1  
I hope this helps. –  dassouki Oct 22 '14 at 12:48
    
@dassouki why would that help me? I don't see that. I hope is there some kind of library what can I use, for example "unidecode" in this script, but I could not find any example for doing that in field calculator. –  gregtom6 Oct 22 '14 at 12:52
    
This may help: gis.stackexchange.com/q/61598/115 –  PolyGeo Oct 22 '14 at 12:57
    
Not really yet. –  gregtom6 Oct 22 '14 at 13:17
    
Not that the code you have is wrong, but you could shorten it by setting the return value at the start and in the if statement changing it as needed, then return the value. Saves an else and multiple returns. –  recurvata Oct 22 '14 at 13:20

1 Answer 1

up vote 4 down vote accepted

Put a u in front of the string so the interpreter knows it's Unicode.

myCalc(!Epulettipus!, u"Lakóépület")
share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.