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

fix decoding of symbol comments #260

Merged
merged 2 commits into from
Oct 19, 2021
Merged

Conversation

dgl-cw
Copy link
Contributor

@dgl-cw dgl-cw commented Aug 23, 2021

It seems that the comment of a symbol is not encoded in utf-8 but in windows-1252.
I could not find it in the documentation of TwinCAT, but tested it on a Windows 10 machine with TwinCAT3.
It also matches the encoding used here:

return message.decode("windows-1252").strip(" \t\n\r\0")

The other strings that are decoded with the _get_string method must be ASCII, which is compatible, so changing this here should not be an issue.

@stlehmann
Copy link
Owner

@dgl-cw thanks for looking into this. Actually it would have been even more helpful to understand the severity of the problem if you raised an issue describing the problem first before providing the PR to fix it. 😉 No worries, I'll create the issue and link the PR to it.

@stlehmann
Copy link
Owner

fixes #275

@stlehmann stlehmann merged commit 8e1c4d6 into stlehmann:master Oct 19, 2021
@coveralls
Copy link

Pull Request Test Coverage Report for Build 1358351849

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 52 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.1%) to 93.975%

Files with Coverage Reduction New Missed Lines %
pyads/utils.py 1 95.45%
pyads/ads.py 10 92.7%
pyads/pyads_ex.py 41 90.09%
Totals Coverage Status
Change from base Build 895069826: -0.1%
Covered Lines: 1622
Relevant Lines: 1726

💛 - Coveralls

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

Successfully merging this pull request may close these issues.

3 participants