Skip to content

Comments

Build zstd with /source-charset:utf-8 option#124475

Merged
rzikm merged 3 commits intodotnet:mainfrom
kzrnm:fix/124474
Feb 17, 2026
Merged

Build zstd with /source-charset:utf-8 option#124475
rzikm merged 3 commits intodotnet:mainfrom
kzrnm:fix/124474

Conversation

@kzrnm
Copy link
Contributor

@kzrnm kzrnm commented Feb 16, 2026

Fix #124474

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Feb 16, 2026
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @karelz, @dotnet/area-system-io-compression
See info in area-owners.md if you want to be subscribed.

@akoeplinger
Copy link
Member

I think we should rather pass /source-charset:utf-8 to the zstd build instead of changing the upstream sources

@kzrnm kzrnm changed the title Avoid non-ascii charactor Build zstd with /source-charset:utf-8 option Feb 16, 2026
@am11
Copy link
Member

am11 commented Feb 16, 2026

Is the issue only in coreclr build (which separately includes this project) or src/native/libs/build-native.cmd (the main native libs entrypoint) also fails?

In either case, it's confusing; if this is actually fixing the build, I’m not sure why this setting isn’t being picked up or inherited:

add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/source-charset:utf-8>) # Force MSVC to compile source as UTF-8.

cc @jkoritzinsky

@am11
Copy link
Member

am11 commented Feb 16, 2026

I think we should rather pass /source-charset:utf-8 to the zstd build instead of changing the upstream sources

The .cmake files at the src/native/external level are ours. The ones in the subdirectories below that are vendor-specific.

@jkotas
Copy link
Member

jkotas commented Feb 16, 2026

I think we should rather pass /source-charset:utf-8 to the zstd build instead of changing the upstream sources

I would propose a PR for upstream as well. Non-ASCII characters in C/C++ sources are endless source of pain.

@akoeplinger
Copy link
Member

akoeplinger commented Feb 17, 2026

In either case, it's confusing; if this is actually fixing the build, I’m not sure why this setting isn’t being picked up or inherited:

add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/source-charset:utf-8>) # Force MSVC to compile source as UTF-8.

hm yeah that's a good question

@rzikm
Copy link
Member

rzikm commented Feb 17, 2026

/ba-g build failures are unrelated

@rzikm
Copy link
Member

rzikm commented Feb 17, 2026

Thanks!

@rzikm rzikm merged commit e399e13 into dotnet:main Feb 17, 2026
153 of 156 checks passed
@kzrnm kzrnm deleted the fix/124474 branch February 17, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-System.IO.Compression community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot build on Windows in a Japanese-language environment

5 participants