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 #12197: Force set /utf-8 for msvc compilers #12198

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

quanzhuo
Copy link

@quanzhuo quanzhuo commented Feb 6, 2025

The MSVC compiler determines the encoding of the source code based on the BOM of the source code when reading it. If there is no BOM, it defaults to the local encoding, which is gb2312, codepage 936, on Simplified Chinese Windows. This can cause errors such as newline characters in strings.

The MSVC compiler determines the encoding of the source code based on
the BOM of the source code when reading it. If there is no BOM, it
defaults to the local encoding, which is gb2312, codepage 936, on
Simplified Chinese Windows. This can cause errors such as newline
characters in strings.
@madebr
Copy link
Contributor

madebr commented Feb 6, 2025

What key does it add to the generated vcxproj xml files?
This change should then also be applied to the projects in the VisualC* folders.

@quanzhuo
Copy link
Author

quanzhuo commented Feb 6, 2025

What key does it add to the generated vcxproj xml files? This change should then also be applied to the projects in the VisualC* folders.

It add <AdditionalOptions>%(AdditionalOptions) /utf-8</AdditionalOptions> under ClCompile under ItemDefinitionGroup to all generated vcxproj xml files

Copy link
Contributor

@madebr madebr left a comment

Choose a reason for hiding this comment

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

LGMT!
Ready for squashing once ci finishes :)

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.

2 participants