Repository navigation
fix(wpf): use UTF-8 for native compilation - #11997
Open
ProjektMing wants to merge 1 commit into
Open
ProjektMing wants to merge 1 commit into
ProjektMing wants to merge 1 commit into
Conversation
Set source and execution charsets in the shared Wpf.Cpp.props compiler options while preserving inherited options. Avoid C4819/C2220 on Windows code page 936 and C4566 in generated copyright attributes. Replace three comment em dashes with ASCII hyphens so those comments do not depend on the source encoding. Validation: - VMR WPF Windows x64 Release restore/build/pack/publish passed with no warnings or errors. - All 29 compiler command logs contain both UTF-8 charset options. - DirectWriteForwarder and System.Printing copyright metadata is correct. - darc vmr diff exported the three-file patch; it matches the validated VMR patch and applies cleanly to the WPF synchronization baseline. - git diff --check passed. AI-generated with OpenAI Codex.
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.
Append /source-charset:utf-8 /execution-charset:utf-8 to inherited compiler options in the shared Wpf.Cpp.props. Also replace the em dash with an ASCII
-.Fixes #11996
Description
On Windows code page 936, MSVC interprets UTF-8 source files without a BOM using the host code page. The em dashes in DirectWriteForwarder's TtfDelta comments trigger C4819/C2220 and stop the WPF build.
Append
/source-charset:utf-8 /execution-charset:utf-8to inherited compiler options in the sharedWpf.Cpp.props. Source-only UTF-8 settings expose C4566 for©in generated C++ assembly attributes on this machine; explicitly selecting the execution charset preserves the copyright text.Replace three comment em dashes with ASCII hyphens. The three-file patch changes the common compiler configuration and comments.
Customer Impact
Contributors using affected Windows code pages cannot build WPF from source. An explicit encoding makes this build behavior independent of the host code page. End-user application impact has not been demonstrated.
Regression
Reproduces at WPF commit
e89a851c5792c8777a7115cc7a797fd0c045fdd4. The first affected release or commit has not been established.Testing
DirectWriteForwarder.dllandSystem.Printing.dllpreserves© Microsoft Corporation. All rights reserved..darc vmr diffand applied to an independent WPF checkout at the synchronized revision. The resulting sources match the validated sources; patch application and whitespace checks passed.Standalone builds, other architectures/configurations, and runtime regression tests were not run.
Risk
Expected risk to existing WPF code is low based on the inspection and successful build. The execution charset can change the bytes of future non-ASCII ordinary narrow literals; callers must use the matching encoding. The input inspection excludes Windows SDK/toolchain headers and does not establish runtime equivalence across all configurations.
Note
This change and PR description were AI-generated with OpenAI Codex.
Microsoft Reviewers: Open in CodeFlow