question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

call_action and Umlauts in arguments - utf-8 documentation

See original GitHub issue

I am not sure if this problem is because of myself, I even debugged your code, but still I am lost what is the problem. In short the problem: although it seems everything to be utf-8, even the name ‘CallBlockerTest-Ümlaut’ itself, it will not work because and only because of the ü (if I remove it, all works fine). I post the stacktrace below. I also searched in the official documentation but did find nothing about how to handle Umlaute/Umlauts correctly… fc is fritzconnection in my case…


        arg = {'NewPhonebookID': pb_id,
               'NewPhonebookEntryID': '',
               'NewPhonebookEntryData':
                   f'<?xml version="1.0" encoding="utf-8"?>'
                   f'<Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">'
                   f'<contact>'
                   f'<category>0</category>'
                   f'<person><realName>{name}</realName></person>'
                   f'<telephony nid="1"><number type="home" prio="1" id="0">{number}</number></telephony>'
                   f'</contact>'
                   f'</Envelope>'}

        return self.fc.call_action('X_AVM-DE_OnTel:1', 'SetPhonebookEntry', arguments=arg)
Traceback (most recent call last):
  File "C:/workspace/python/a1-fritzbox/a1fritzbox/phonebook.py", line 146, in <module>
    result = pb.add_contact(2, 'CallBlockerTest-Ümlaut', '009912345', skip_existing=False)
  File "C:/workspace/python/a1-fritzbox/a1fritzbox/phonebook.py", line 81, in add_contact
    return self.fc.call_action('X_AVM-DE_OnTel:1', 'SetPhonebookEntry', arguments=arg)
  File "C:\Python3\lib\site-packages\fritzconnection\core\fritzconnection.py", line 215, in call_action
    return self.soaper.execute(service, action_name, arguments)
  File "C:\Python3\lib\site-packages\fritzconnection\core\soaper.py", line 194, in execute
    return handle_response(response)
  File "C:\Python3\lib\site-packages\fritzconnection\core\soaper.py", line 176, in handle_response
    raise_fritzconnection_error(response)
  File "C:\Python3\lib\site-packages\fritzconnection\core\soaper.py", line 105, in raise_fritzconnection_error
    raise exception(message)
fritzconnection.core.exceptions.FritzConnectionException: UPnPError: 
errorCode: 502
errorDescription: XML error

BTW, if I use &uuml; instead of ü it will work and arrive as ü in the phonebook. But TBH I don’t want to create html entities, or do I have to? Although everything is set to utf-8, even the content-type header? Is it something AVM Fritzbox specific?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
kbrcommented, Jul 17, 2020

Fixed with 1.3.3 So I like to close this.

0reactions
bufemccommented, Jul 17, 2020

Just if anyone would pass by later, again:

After doing pip install fritzconnection --upgrade

the situation is this now:

I can add something with Umlaut now, without any 502 error etc, but it arrived first in the phonebook as:

CallBlockerTest-Umläut

So I re-checked my envelope, and it is mandatory to have

                   f'<?xml version="1.0" encoding="utf-8"?>'
                   f'<Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">'

in the beginning, so the “Umläut” arrives now correctly.

Thank you a lot! Best Fritz lib ever ,)

Read more comments on GitHub >

github_iconTop Results From Across the Web

react native - Firestore document with umlaut, two different "ö"
My problem is, when I try to set up a new document in my firestore with a name including umlaut "ö" it writes...
Read more >
UTF-8 and Unicode FAQ for Unix/Linux
All you need to know to use Unicode/UTF-8 on Unix and Linux systems.
Read more >
command-line-arguments can't read umlauts with utf-8 encoding
So, anyway, it seems like there are two problems here: The expression editor isn't able to take in unicode characters.
Read more >
Package trackchanges: problem with UTF8 - TeX
This seems to be an issue of the internally used soul package (Strike-Out, UnderLine) used for highlighting of the changes. It reads the...
Read more >
Providing some UTF-8 support via inputenc - TeXDoc
As we have argued elsewhere, LATEX needs to refer to characters via ... an umlaut accent'. ... The document does not appear to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found