Skip to content

gateway.vbs/gateway.cmd encoding issue on Windows with CJK username paths #107416

Description

@pipe-gale01

Problem

On Windows with a CJK (Chinese/Japanese/Korean) username, the gateway service fails to start because gateway.vbs and gateway.cmd are written in UTF-8 encoding.

Windows Script Host (wscript.exe) only supports ANSI (GBK on Chinese Windows) or UTF-16 LE BOM for .vbs files. When it reads the UTF-8 file, the CJK characters in the path (e.g. C:\Users\苗振\.openclaw\gateway.cmd) become garbled, resulting in "file not found" errors.

Similarly, cmd.exe uses the system ANSI codepage (GBK/936), so gateway.cmd with UTF-8 encoded Chinese paths also fails.

Steps to Reproduce

  1. Windows user with a CJK username (e.g. C:\Users\苗振)
  2. Run iwr -useb https://openclaw.ai/install.ps1 | iex
  3. The gateway install/refresh step fails with a popup: "找不到 C:\Users\苗振.openclaw\gateway.vbs"

Root Cause

In the installer, gateway.vbs and gateway.cmd are written using default PowerShell encoding (UTF-8 without BOM). Windows Script Host and cmd.exe cannot decode CJK characters from UTF-8.

Suggested Fix

When writing these files, use the appropriate encoding:

  • gateway.vbs: UTF-16 LE BOM ([System.Text.Encoding]::Unicode)
  • gateway.cmd: System ANSI codepage ([System.Text.Encoding]::Default or GetEncoding('gbk'))

Example:

# gateway.vbs
[System.IO.File]::WriteAllText(, , [System.Text.Encoding]::Unicode)

# gateway.cmd
[System.IO.File]::WriteAllText(, , [System.Text.Encoding]::Default)

Environment

  • OS: Windows 11 (10.0.22621)
  • Username path: C:\Users\苗振
  • OpenClaw: 2026.7.1 (2d2ddc4)
  • Node.js: v24.15.0

Metadata

Metadata

Assignees

Labels

P0Emergency: data loss, security bypass, crash loop, or unusable core runtime.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:ux-release-blockerA non-technical user is blocked without terminal, logs, config, or support.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.no-staleExclude from stale automation

Type

No type

Fields

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions