pysoem icon indicating copy to clipboard operation
pysoem copied to clipboard

UnicodeDecodeError raised by umlauts in adapter drescription.

Open Werdf opened this issue 3 years ago • 1 comments

https://github.com/bnjmnp/pysoem/blob/fbf7d8abc855454c0f2589d277e0830d1255ba8d/pysoem/pysoem.pyx#L80

Hello @bnjmnp,

when I call the find_adapters-function I get an UnicodeDecodeError exception, because of umlauts in the adapter drescription. The adapter description might be encoded in ansi.

Is it possible to remove these decode calls of name and adapter description? or make the encoding parameterizable, because of downward compatibility?

Thank you

Greetings from Langebrück ;)

Werdf avatar Aug 31 '21 19:08 Werdf

Hi @Werdf,

Thank you for this.

I guess I have expected the description to be in pure ASCII. But yes, it makes sense to return name and description as a byte array. I will figure out a solution for this.

bnjmnp avatar Sep 01 '21 05:09 bnjmnp

It has bin a while, I actually solved this already in version 1.1.0. The description is now a raw byte array, so the decoding is up to the user. The name will still be decoded with the hope that no one uses non-ASCII characters there.

bnjmnp avatar Feb 17 '24 14:02 bnjmnp