If you are trying to write a Cinnamon extension/applet and having this error when trying to parse some data that you have fetched via
Failed to convert UTF-8 string to JS string: Invalid byte sequence in conversion input
Soap.Session instead of
Soap.SessionAsync may solve your problem.
I’ve encountered this problem when working with StackExchange API which always returns data in compressed format regardless of request headers. It turns out Soap.SessionAsync doesn’t automatically decode data according to its encoding headers. You have to initiate decoding explicitly.
Or you could just use
Soap.Session which handles decoding as you would expect.
SessionAsync class. For simple purposes though
Session class can be used which is capable of handling both synced and asynced requests.