Description

When UnrealBuildTool (UBT) is launched by UAT, for example by RunUAT.bat BuildCookRun build, localized (Japanese) MSVC error messages show up garbled in the console and in UAT's Log.txt. The UBT log (UBA*.txt) contains the correct text.

The cause is an encoding mismatch:

  • UAT starts UBT with CreateNoWindow = true, so UBT gets a new hidden console that uses the system OEM code page (932 / Shift_JIS). UBT writes its stdout in that code page.
  • UAT reads UBT's stdout as UTF-8. Characters that can't be decoded become U+FFFD, so the original text is lost.

Workarounds

Pass ERunOptions.NoHideWindow to RunUBT (RunUBT function in UBTUtils.cs). UBT then shares UAT's console, so the code pages match.

Steps to Reproduce
  1. Install the Japanese language pack for MSVC
    1. Open Visual Studio Installer, click Modify on VS 2022, go to the Language packs tab, select Japanese and install it.
  2. Change the system locale to Japanese (it makes default codepage to 932 (shift-JIS))
    1. Open PowerShell with Run as administrator.
    2. Check the current system locale. It should be en-US:
      Get-WinSystemLocale
    3. Change the system locale to Japanese:
      Set-WinSystemLocale ja-JP
    4. Restart your PC
    5. Open a new Command Prompt and run chcp. It should print Active code page: 932.
  3. Create a C++ project that fails to compile
    1. Create a new C++ project from any template (for example, Blank).
    2. Add this line at file scope in any .cpp file:
      Foobar a;
  4. Build via UAT
    Open a Command Prompt (code page 932, the default) and run:
set VSLANG=1041
<EngineDir>\Engine\Build\BatchFiles\RunUAT.bat BuildCookRun -project="<ProjectDir>\<Project>.uproject" -unrealexe="<EngineDir>\Engine\Binaries\Win64\UnrealEditor-Cmd.exe" -platform=Win64 -clientconfig=Development -build -cook -nop4 -noturnkeyvariables

VSLANG=1041 makes MSVC print its diagnostics in Japanese.

Expected Result:

The UAT console output and Log.txt show the compiler errors correctly, the same as UBA-*.txt:

error C2146: 構文エラー: ';' が、識別子 'a' の前に必要です。

Actual Result:

The UAT console output and Log.txt are garbled. In Log.txt, the non-ASCII bytes are replaced with U+FFFD (EF BF BD):

error C2146: �\���G���[: ';' ���A���ʎq 'a' �̑O�ɕK�v�ł��B

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-400385 in the post.

0
Login to Vote

Unresolved
ComponentUE - Core - Cpp Tools
Affects Versions5.8
CreatedOct 2, 2026
UpdatedOct 3, 2026
View Jira Issue