def Befahrung(value1,value2):
  if value1 is ' ':
    return ' '
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)

  • 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