Skip to content

build: pass /utf-8 to tinygettext so non-UTF-8 locales can build - #2532

Merged
flyinghead merged 1 commit into
flyinghead:masterfrom
badatbit:fix/msvc-utf8-source-charset
Oct 7, 2026
Merged

flyinghead merged 1 commit into
flyinghead:masterfrom
badatbit:fix/msvc-utf8-source-charset

Conversation

@badatbit

@badatbit badatbit commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

MSVC decodes source files that have no BOM using the active code page. On a Windows install whose system locale is not UTF-8 (Japanese, Korean, ...), the non-ASCII literals in core/deps/tinygettext/src/language.cpp (the native language names) are mis-decoded and the build fails:

language.cpp(59,52): error C2001: newline in constant
language.cpp(59,52): error C2064: term does not evaluate to a function taking 1 arguments

The main target already gets /utf-8; the tinygettext dependency was missed. This adds /utf-8 to that target only, under if(MSVC), so GCC/Clang builds are unaffected. CI runners use an English locale, which is why it hasn't shown up there.

Tested: MSVC (Visual Studio 2026 Build Tools, x64) on a Korean-locale Windows 11 fails without the change and builds with it.

🤖 Generated with Claude Code

MSVC decodes source files that have no BOM using the active code page. On a
Windows install whose system locale is not UTF-8 (Japanese, Korean, ...) the
non-ASCII literals in core/deps/tinygettext/src/language.cpp -- the native
language names such as "Espanol" or "Azerbaycanca" -- are mis-decoded and the
build fails:

    language.cpp(59,52): error C2001: newline in constant
    language.cpp(59,52): error C2064: term does not evaluate to a function
                                      taking 1 arguments

The main target already gets /utf-8 (CMakeLists.txt:294); this dependency was
missed. CI runs on an English locale, which is why it has gone unnoticed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@badatbit
badatbit force-pushed the fix/msvc-utf8-source-charset branch from e87daba to 10df27f Compare October 5, 2026 04:16
@flyinghead
flyinghead merged commit df5feec into flyinghead:master Oct 7, 2026
19 checks passed
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