pysoem
pysoem copied to clipboard
Object Entry Name: Decoding fails
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
Hi. I should have better just returned the bytes, without decoding them...? Who knows if latin encoding is used consistently by all device vendors.
Hey! Yes, I guess returning bytes is the easiest and most convenient way to solve that. :+1: