-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
windows doesn't print emojis correctly #6001
Comments
Cannot reproduce on macOS 10.15.4:
but can reproduce on Windows 10 (in PowerShell):
|
If you run |
Yep, that works for me too 👍 Seems strange that |
I'd assume that it's calling |
I think it uses WriteConsoleW. Supposedly |
I just run into the same issue trying to use characters like
Worked for me too, as a temp solution. |
I think In fact, since other programs may run in the same console afterwards, I think it's best practice to reset the code page before exit: UINT original_codepage;
void init() {
original_codepage = GetConsoleOutputCP();
SetConsoleOutputCP(CP_UTF8);
}
void cleanup() {
SetConsoleOutputCP(original_codepage);
} |
#6131 The details of the problem are explained, and how to solve it under Windows. |
That's true, but here's the secret: WriteConsoleW doesn't depend on the code page, it always uses UTF16 (technically UCS2). |
Thanks for sharing this! That's good to know. Well, back to the problem: I'd assume that |
@piscisaureus I just traced the two commands using API Monitor. I can confirm that |
Hi I'm pretty new to all this but I thought this was interesting, see my attached screenshot. I found that the emojis did not display correctly in Windows Powershell (2), Powershell 7.1 (3) or the terminal in VS Code (4) but they do display correctly if you use Windows Powershell or Powershell 7.1 with the new Windows Terminal app (1). So maybe the Terminal is able to interpret the unicode properly where as the Powershell by itself isn't a full unicode native. |
[Console]::OutputEncoding = [Text.UTF8Encoding]::UTF8 did the trick for me while To keep this setting persistent, you can create a |
Same issue when using the request permissions API in Windows Terminal with WSL. |
Perhaps access to stdout could be standardized. Currently all the Line 76 in 4d6f412
As a side note, it's becoming increasingly difficult to consider Deno as a serious platform for our cross-environment development since the core developers treat Windows issues as one of their lowest priorities. I'd gladly pick up some slack and dive into these issues to make Deno have parity on Windows, but I would need some incentive since it would involve taking time to learn Rust as well as time away from my other projects. |
@piscisaureus PTAL |
Hi! This is my first time looking at Deno, and it seems to be very exciting :)
I was playing around with the examples from the tutorial and noticed this inconsistency: (using powershell and windows terminal):
I found that editing
curl.ts
to add the lineand replacing the
Deno.stdout.write
line withseems to make the downloaded file print out correctly.
The text was updated successfully, but these errors were encountered: