lua-debug icon indicating copy to clipboard operation
lua-debug copied to clipboard

Is it possible to run lua files encoded in GB2312?

Open whc2001 opened this issue 3 years ago • 6 comments

I have a lot of lua source files encoded in GB2312, and my OS locale is zh-CN (same with non-Unicode locale settings). I tried every setting combinations of "Console Coding" and "Source Coding" in plugin settings, but seems like the Chinese characters cannot be displayed correctly. If I save as UTF-8 then it works. Anyway to solve that since in the production environment I'll have to use GB2312?

image

whc2001 avatar Jan 06 '22 13:01 whc2001

lua-debug will not do any processing on the output of print. You can output to the terminal instead of the debug console to solve this problem.

            "console": "integratedTerminal",
            "outputCapture": [
            ],

actboy168 avatar Jan 07 '22 02:01 actboy168

I tried to put these to launch.json but seems like it still does not work. image

whc2001 avatar Jan 07 '22 12:01 whc2001

I can't reproduce.

actboy168 avatar Jan 10 '22 02:01 actboy168

Seems like the problem is that it's still using the built-in terminal rather than using cmd from Windows. I tried to run the script with lua5.1.exe from cmd and it prints correctly.

whc2001 avatar Jan 10 '22 16:01 whc2001

一样的问题,调试控制台中文乱码,设置了参数还是一样 文件编码:gb2312 "consoleCoding": "ansi", "sourceCoding": "ansi",

"Lua.runtime.version": "Lua 5.1", "files.encoding":"gb2312", "lua.debug.settings.consoleCoding": "ansi", "lua.debug.settings.sourceCoding": "ansi", "Lua.runtime.fileEncoding": "ansi", "lua.debug.settings.luaVersion": "5.1",

但是如果将文件编码改为utf8,print就能输出中文,(项目要求GB2312...)

chigco avatar Jan 24 '22 12:01 chigco

调试过程中,变量页内容涉及到中文也全都显示乱码。

chigco avatar Jan 28 '22 02:01 chigco