Fix Windows build on non-UTF-8 locales (/utf-8 template + serious_python 4.3.3)#6687
Merged
Conversation
serious_python 4.3.3 fixes `flet build windows` failing on non-UTF-8 system locales (e.g. code page 936/GBK on Simplified-Chinese Windows) with warning C4819 escalated to error C2220 while compiling the Windows plugin. Pin the build template to it and add a 0.86.1 changelog entry. Fixes #6686
Deploying flet-website-v2 with
|
| Latest commit: |
7619abc
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://922cf30c.flet-website-v2.pages.dev |
| Branch Preview URL: | https://fix-bump-serious-python-4-3.flet-website-v2.pages.dev |
The build template compiles every plugin (and the runner) with /WX, so any plugin whose Windows source contains a non-ASCII byte fails with C4819 -> C2220 on non-UTF-8 system locales (e.g. code page 936/GBK on Simplified-Chinese Windows). This hits third-party plugins flet can't patch (reported for connectivity_plus, in addition to serious_python). Add /utf-8 to APPLY_STANDARD_SETTINGS so all targets read sources as UTF-8 regardless of the build machine's code page. Fixes #6686
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes
flet build windowsfailing on non-UTF-8 system locales (e.g. Simplified-Chinese Windows, code page 936/GBK).Problem
The build template compiles every plugin (and the runner) with
/WX(warnings-as-errors). Any plugin whose Windows source contains a non-ASCII byte — e.g. an em dash in a comment — can't be decoded under a non-UTF-8 system code page, so MSVC emits C4819, which/WXescalates to a fatal C2220:This is not limited to one plugin. It was first reported for
serious_python_windows_plugin.cpp, and after that was patched the reporter hit the same failure inconnectivity_plus_plugin.cpp— a third-party plugin flet can't patch. Any plugin can trip this.Fix
Two layers:
/utf-8toAPPLY_STANDARD_SETTINGSin the Windows CMakeLists template. Every plugin and the runner call this function, so all Windows sources are now read as UTF-8 regardless of the build machine's code page — covering third-party plugins (connectivity_plus, etc.) without needing an upstream fix in each.serious_python4.3.2 → 4.3.3, which removes the offending character from its own plugin and also compiles with/utf-8(flet-dev/serious-python#234, released).Plus a 0.86.1 CHANGELOG entry.
Fixes #6686