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 gnuplot --version encoding handling on Windows #755

Merged

Conversation

sandersaares
Copy link
Contributor

In some configurations, gnuplot --version will emit output as UTF-16 bytes instead of UTF-8. This is not expected by parse_version() which always expects UTF-8.

This change enhances parse_version() with a simple fallback - if UTF-8 parsing fails, it will try again with UTF-16.

Fixes #570.

@sandersaares
Copy link
Contributor Author

@bheisler @lemmih ping for attention. Would appreciate getting this merged to unblock the feature on Windows.

Copy link
Contributor

@samueltardieu samueltardieu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be simpler when String::from_utf16le() is stabilized. In the meantime, this looks correct, although I cannot test this particular mode because I don't have a Windows box. This doesn't break the Unix tests though.

@samueltardieu
Copy link
Contributor

@sandersaares If you could rebase your PR on the latest master, this would help to have a clean CI build.

In some configurations, `gnuplot --version` will emit output as UTF-16 bytes instead of UTF-8. This is not expected by `parse_version()` which always expects UTF-8.

This change enhances `parse_version()` with a simple fallback - if UTF-8 parsing fails, it will try again with UTF-16.
@sandersaares sandersaares force-pushed the sasaares/fix-gluplot-win-utf16-handling branch from 41dba44 to ce2f85d Compare April 1, 2024 14:56
@sandersaares
Copy link
Contributor Author

Rebased

@sandersaares
Copy link
Contributor Author

sandersaares commented Jul 11, 2024

@bheisler @lemmih @waywardmonkeys ping for attention. Would love to light up this feature on Windows!

@lemmih lemmih merged commit 1a18e88 into bheisler:master Jul 11, 2024
4 checks passed
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.

Can not find gnuplot 5.4 on Windows
3 participants