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 crash for non-ASCII characters #5

Merged
merged 3 commits into from
Apr 11, 2024

Conversation

jan1854
Copy link
Contributor

@jan1854 jan1854 commented Apr 9, 2024

_DataManager throws a UnicodeDecodeError if the message contains a non-ASCII character that can be encoded with latin-1 encoding, e.g., °. The message is encoded with latin-1 and then decoded with decode(). The decode() function without arguments defaults to UTF-8 encoding, so the code attempts to UTF-8 decode a message encoded with latin-1, causing the exception. I fixed this problem by passing the correct encoding to decode().

I further removed the UTF-8 encoding / decoding since the result is not used, and the latin-1 encoding / decoding is stricter anyway.

@vincentberenz vincentberenz self-assigned this Apr 11, 2024
@vincentberenz
Copy link
Contributor

Thanks for the update !

@vincentberenz vincentberenz merged commit 289286e into MPI-IS:master Apr 11, 2024
1 of 2 checks passed
@jan1854 jan1854 deleted the bugfix/latin1-decoding branch April 11, 2024 08:01
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.

None yet

2 participants