Fix Windows build failure on non-UTF-8 locales (C4819/C2220)#234
Open
FeodorFitsner wants to merge 1 commit into
Open
Fix Windows build failure on non-UTF-8 locales (C4819/C2220)#234FeodorFitsner wants to merge 1 commit into
FeodorFitsner wants to merge 1 commit into
Conversation
serious_python_windows_plugin.cpp contained a non-ASCII character (an em dash) in a comment. On a system whose code page isn't UTF-8 (e.g. 936/GBK on Simplified-Chinese Windows) MSVC decodes the UTF-8 source as GBK, can't represent the bytes and emits warning C4819, which the Flutter template's /WX escalates to a fatal C2220 -> `flet build windows` fails. Remove the character and compile the Windows plugin with /utf-8 so any future non-ASCII source byte is read correctly regardless of the build machine's code page. Also drop the same stray character from the Linux plugin source (GCC tolerated it, no build impact). Bump all packages 4.3.2 -> 4.3.3 with changelog entries. Fixes flet-dev/flet#6686
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.
Problem
flet build windowsfails on Simplified-Chinese Windows (and any non-UTF-8 system locale) while compiling the serious_python Windows plugin:Reported in flet-dev/flet#6686.
Root cause
serious_python_windows_plugin.cppline 39 contained a non-ASCII character — an em dash (—, U+2014) — in a comment, and the file has no BOM. On a system whose active code page isn't UTF-8 (Simplified-Chinese Windows defaults to 936/GBK), MSVC decodes the UTF-8 source bytes as GBK, can't represent the sequence, and emits C4819. The Flutter plugin template compiles with/WX(warnings-as-errors), which escalates it to a fatal C2220 — so the whole build fails.This is a regression in Flet 0.86: the comment was introduced with serious_python 3.0.0 (commit
eb2ee4b), the version bundled with 0.86.Fix
serious_python_windows_plugin.cpp(the direct cause)./utf-8so MSVC always reads sources as UTF-8 regardless of the build machine's code page — any future non-ASCII source byte is handled correctly.serious_python_linux_plugin.ccfor consistency (GCC reads UTF-8 by default, so there was no build impact on Linux).Release
Bumps all packages 4.3.2 → 4.3.3 (lockstep) with CHANGELOG entries. No runtime changes — bundled Python (3.12.13 / 3.13.14 / 3.14.6) and
dart_bridge(1.5.0) are unchanged from 4.3.2.Fixes flet-dev/flet#6686