Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object Entry Name: Decoding fails #101

Open
hstroetgen opened this issue Mar 16, 2023 · 2 comments
Open

Object Entry Name: Decoding fails #101

hstroetgen opened this issue Mar 16, 2023 · 2 comments

Comments

@hstroetgen
Copy link

hstroetgen commented Mar 16, 2023

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).

return (<bytes>self._ex_oelist.Name[self._item]).decode('utf8')

@bnjmnp
Copy link
Owner

bnjmnp commented Mar 20, 2023

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants