denoland / denoland/deno

console.log of non-ASCII text is mojibake on Windows consoles with a non-UTF-8 code page (no WriteConsoleW)

Open
#28,362 1 comment 0 reactions 0 assignees View on GitHub
windows
Dominant language
Rust
Stars
108k
Forks
6.4k
Avg merge
3d 33m
Merged PRs (30d)
57

Description

Version: Deno 2.2.2

![Image](https://github.com/user-attachments/assets/2b4ecaac-f27f-42bd-b05b-bcae35b9e905)

My repo uses ps12exe to help users install git, deno, and start the repo.
But it seems that deno's Chinese output in ps12exe is messed up.

![Image](https://github.com/user-attachments/assets/fd2be7f2-f480-46e4-aa70-da371dab3836)

# reproduce:
1. open powershell on Windows
2. Install ps12exe by:
```powershell
Install-Module ps12exe -Scope CurrentUser -Force
```
It'll download an 1mb powershell moule for generate exe, you can remove it by `Uninstall-Module ps12exe`
3. Run the following command:
```powershell
deno eval "console.log('测试')" # outputs: 测试
"deno eval `"console.log('测试')`"" | ps12exe
./a.exe # outputs: 娴嬭瘯
"'测试'" | ps12exe
./a.exe # outputs: 测试

```

![Image](https://github.com/user-attachments/assets/20a9491b-0c95-4ccd-b4c6-78a9747ef6c4)

You don't need to install powershell core, use windows powershell that comes with windows and make sure deno is in your path can also reproduce this.
![Image](https://github.com/user-attachments/assets/02d05a27-59af-405d-9df7-81c8e0658efb)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.