denoland / denoland/deno

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

Aperta
#28,362 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
windows
Lingua principale
Rust
Stelle
108k
Fork
6.4k
Merge medio
2g 22h
PR unite (30g)
59

Descrizione

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)

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.