pysoem icon indicating copy to clipboard operation
pysoem copied to clipboard

Object Entry Name: Decoding fails

Open hstroetgen opened this issue 1 year ago • 2 comments

I have a Beckhoff PWM Terminal and there exists an object entry whose name contains a "µ" (0xb5). As soon I call the property name the decoding failes at byte 0xb5. It seems the encoding of the string is "latin" (µ: 0xb5) and not "UTF-8" (µ: 0xc2b5).

https://github.com/bnjmnp/pysoem/blob/d52cd51de2d915692abe394a7232743e35f7cb6a/pysoem/pysoem.pyx#L1128

hstroetgen avatar Mar 16 '23 10:03 hstroetgen

Hi. I should have better just returned the bytes, without decoding them...? Who knows if latin encoding is used consistently by all device vendors.

bnjmnp avatar Mar 20 '23 06:03 bnjmnp

Hey! Yes, I guess returning bytes is the easiest and most convenient way to solve that. :+1:

hstroetgen avatar Mar 20 '23 09:03 hstroetgen