EpicGamesExt / raddebugger

A native, user-mode, multi-process, graphical debugger.
MIT License
3.1k stars 163 forks source link

cpp, Simplified Chinese garbled #230

Open fairycn opened 1 month ago

fairycn commented 1 month ago

cpp, Simplified Chinese garbled As shown in the following figure when there is Simplified Chinese in the code, the relevant characters cannot be displayed normally image

skejeton commented 1 month ago

Looks like the font doesn't support Chinese glyphs and the font renderer doesn't fallback. Does it work if you change to a font with Chinese glyphs in it?

fairycn commented 1 month ago

The software does not find a place to configure the font options, can you tell me how to configure it, I'll test it on my side.

bielok commented 1 month ago

Open %appdata%/raddbg/default.raddbg_user and scroll to

/// fonts /////////////////////////////////////////////////////////////////////

code_font: ""
main_font: ""

You can place a .ttf font file in %appdata%/raddbg/ and reference it like code_font: "my_font.ttf"

I was able to render "你好" using BabelStoneHan.ttf, but that is not a proper programming font.

fairycn commented 1 month ago

Thank you, to pass this method to solve the font display problem, but found that the code file in the first line more than an unknown character (not caused by the font file, you can refer to the previous picture, not set the body of the code file at the beginning of the contents of the content compared to the source code more than some of the content.) image EF BB BF image

bielok commented 1 month ago

I am having trouble understanding what you are saying in English!

Could you try DeepL or some LLM (ChatGPT or similar) to help clarify the translation?

My understanding is that you are noticing 3 unexpected characters rendered as boxes right before the comment on line 1, that is, EF BB BF which is the UTF-8 Byte Order Mark (BOM). I believe you can save your files with a different encoding, without BOM, to stop those characters from showing up. This may help for VSCode.

Having said that, better handling of BOM in the debugger would be good. If my understanding of the remaining problem is correct we should perhaps track it in a different issue, as other encoding nuances may arise.

fairycn commented 1 month ago

Yes, it means what you understand it to mean (the code file is generated by the vs 2022 default settings)