2
def Befahrung(value1,value2):
  if value1 is ' ':
    return ' '
  else: 
return "G:\\Example\\" + str(value1) + "\\File_" + str(value2) + ".pdf"

I try to create a field with a hyperlink. It works very well until i hit a special charakter. What do i have to change?

This is the error:

ERROR 000539: Error running expression: Befahrung(u" ",u"Mönch")

Traceback (most recent call last):

File "", line 1, in

File "", line 5, in Befahrung

UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 5: ordinal not in range(128)

closed as off-topic by Jason Scheirer, PolyGeo, Chris W, Get Spatial, Matthias Kuhn Aug 27 '14 at 9:28

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about software development are off-topic here unless they relate directly to Geographical Information Systems, but they can be asked on Stack Overflow." – Jason Scheirer, PolyGeo, Chris W, Get Spatial, Matthias Kuhn
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 3
    This question is more for stackoverflow – RickyA Aug 22 '14 at 9:58
  • 1
    Does this code work when you run it from an IDE like IDLE? If it does, then it may point to a Field Calculator issue, but, if not, then I think it is better researched/asked on Stack Overflow. – PolyGeo Aug 22 '14 at 10:54
  • Error in IDLE, too. I will try it in stackoverflow. ExecuteError: ERROR 000539: SyntaxError: EOL while scanning string literal (<expression>, line 1) – GEOGEO Aug 22 '14 at 11:11
  • When you use a different argument for value2 using plain text (such as "test"), do you still get the issue? – papadoo Aug 22 '14 at 17:52
  • The asker has posted to Stack Overflow now so to see the outcome click stackoverflow.com/questions/25445982/… – PolyGeo Aug 22 '14 at 22:59