vscode-cpptools icon indicating copy to clipboard operation
vscode-cpptools copied to clipboard

display utf-8 characters on debug watch panel

Open weinand opened this issue 7 years ago • 12 comments

From @KuddLim on July 26, 2017 8:27

  • VSCode #Version: 1.14.2
  • OS Version: LMDE 2 Betsy x86_64

Steps to Reproduce:

  1. Make a simple c++ project
  2. declare std::string (or std::wstring) and put some CJK string to it.
  3. Launch gdb session
  4. Watch variable

Reproduces without extensions: Yes

in vscode, variables are represented in numerics vscode

in gdb, variable are represented correctly, gdb

Here's the content of ~/.gdbinit set target-wide-charset UCS-4

Copied from original issue: Microsoft/vscode#31442

weinand avatar Jul 26 '17 08:07 weinand

I can confirm having almost the same problem. But in my case I can't display cyrillic strings in UTF-8 properly. All they are displayed in the following manner (see the image) изображение

alex-kravets avatar Mar 31 '21 08:03 alex-kravets

Same when I try to watch Chinese strings in Unicode/multibyte. It appears like this. vscode_bug

Pika-Lee avatar Mar 18 '23 15:03 Pika-Lee

Well it's barely year 2000, I don't think that a modern IDE is really expected to understand more than ASCII Given the low importance of international support while computer and internet are still not wide spread outside of the US and UK markets I don't think this warrants a bugreport.

cmp-nct avatar Jul 02 '23 20:07 cmp-nct

Just want to say that this issue is still present and not limited to cpp.

I feel like debugger and correct display of variable values at runtime is pretty important. And I don't understand why is this not prioritized more.

This is how the strings in my Python script look like: image

anderer455 avatar Feb 08 '24 10:02 anderer455

@meganrogge, can you help this issue to receive an assignee? Thanks!

Challanger524 avatar Apr 04 '24 17:04 Challanger524

cc @connor4312

meganrogge avatar Apr 04 '24 19:04 meganrogge

VS Code supports this, it's up to the extension to send the characters over.

connor4312 avatar Apr 04 '24 20:04 connor4312

@sean-mcmanus, you should be the right person who knows how to put this issue on track 🙏

Challanger524 avatar Apr 04 '24 22:04 Challanger524

@Challanger524 I am not -- I work on the language server component and not on the debugger component (and I don't know much about the debugger component). Does anyone know if this can be fixed at https://github.com/microsoft/MIEngine ?

sean-mcmanus avatar Apr 04 '24 23:04 sean-mcmanus

@sean-mcmanus interesting point, but... I've checked Visual Studio 22 variables display in debugger, utf-8 strings are showing properly (with no flaws). Since MIEngine is mutual (as it seems) for both frameworks - my assumption is that Debugger Component in vscode-cpptools is a good place to start digging.

Maybe @bobbrow knows who can be brought to this conversation according to the topic?

Challanger524 avatar Apr 05 '24 07:04 Challanger524

@Challanger524 It would be @WardenGnaw (or someone else on the VS debugger team), but he's not currently working on VS Code debugger issues.

sean-mcmanus avatar Apr 05 '24 18:04 sean-mcmanus

UPD: noticed that vscode-cpptools/debugger shows utf-8 strings only if they are presented via char ptr/std::string. So I assume that C++20 addition of char(8/16/32)_t self-sustaining types is just not reflected in cpp-tools debugger window yet.

Challanger524 avatar Apr 09 '24 07:04 Challanger524

@Pika-Lee Have you solved that problem yet? thanks

eandw avatar Jul 01 '24 00:07 eandw