Skip to content

[Build] C++ projects fail with C4819 on code page 936 #49573

Description

@gavinzhangth

Microsoft PowerToys version

Current main at d72fa2e.

Installation method

Dev build in Visual Studio.

Area(s) with issue?

Keyboard Manager, ZoomIt

Steps to reproduce

  1. Use Windows with active code page 936.
  2. From src/modules/keyboardmanager/KeyboardManagerEngineTest, run tools/build/build.cmd -Platform x64 -Configuration Debug.
  3. From src/modules/ZoomIt/ZoomItBreak and src/modules/ZoomIt/ZoomIt, run the same build command.

Expected behavior

The C++ projects should compile their UTF-8 source files independently of the active Windows code page.

Actual behavior

MSVC interprets the UTF-8 source files using code page 936 and emits C4819 for typographic punctuation in comments and diagnostic strings. Because warnings are treated as errors, the builds fail with C2220.

Examples include KeyboardEventHandlers.cpp, Keyboard Manager test sources, ZoomIt.h, BreakTimer.h, and several ZoomIt recording and webcam sources.

Additional information

Setting the affected projects to compile as UTF-8 fixes the decoding mismatch without disabling warnings or changing the source text. Verified with Visual Studio 2026, x64 Debug.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions