question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Chinese messages appear garbled in debug console

See original GitHub issue

As reported by @DFVSQY here https://github.com/Microsoft/vscode/issues/35235

  1. Have the following program
using System;

namespace files
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("文件 编辑 选择 查看 转到 调试 任务 帮助");
            Console.WriteLine("哈哈");
        }
    }
}
  1. Have your windows machine setup to use simplified chineese
  2. Have vscode setup to use simplified chineese
  3. Run the program, notice garbled characters
  4. Notice garbled output in the C# extension output channel

Work around:

Add the following at the start of the program:

    Console.OutputEncoding = System.Text.Encoding.UTF8;

Alternative work around:

Edit launch.json to change "console" to use the integrated terminal:

    "console": "integratedTerminal"

Notes:

  • this is not happening with other debug adapters thus I am assuming that the C# debug backend is sending wrong characters to vscode.
  • I was not able to reproduce this with just setting vscode to use chineese, I think the whole OS language has to be changed.
  • I get lots of bugs around this in the vscode repo from chineese people every mileston only for C# debugging.

Please ping if you need more details.

31177450-a84ab022-a948-11e7-99c7-6be320405fa6

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:33 (20 by maintainers)

github_iconTop GitHub Comments

1reaction
dbaeumercommented, Oct 26, 2017

@gregg-miskelly thanks. With the support of running tasks in the terminal this is not needed anymore since the terminal itself already allows to specify encodings.

0reactions
donaldnevermorecommented, Dec 3, 2019
Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does debugging with lldb in VSCode garble chinese ...
it renders weird characters to the VSCode debug terminal. I thought the problem would go away after installing language pack, but no such...
Read more >
idea build console display Chinese in garbled code
idea build console display Chinese in garbled code Follow​​ when run "gradle build" in terminal, Chinese characters are display correctly. But if ...
Read more >
The console displays garbled characters in Chinese?
My computer has been displaying normally before, and I did not install new software and updates, and suddenly it showed Chinese garbled characters....
Read more >
How Do I Solve the Problem that Chinese Characters Are ...
When an app project is created, Chinese characters are displayed as garbled characters in, for example, the README_CN.md file. See Figure 1.
Read more >
PowerShell Console characters garbled for Chinese ...
PowerShell Console characters are garbled for Chinese, Japanese, and Korean languages on Windows Server 2022.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found