bnjmnp / pysoem

Cython wrapper for the Simple Open EtherCAT Master Library
MIT License
95 stars 36 forks source link

Object Entry Name: Decoding fails #101

Open hstroetgen opened 1 year ago

hstroetgen commented 1 year ago

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

bnjmnp commented 1 year ago

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

hstroetgen commented 1 year ago

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