[ZeroBrane Studio] Re: Cannot activate a file with chinese path when using ZeroBrane remote debugging

  • From: SUN Zhuo <mixwind@xxxxxxxxx>
  • To: zerobrane@xxxxxxxxxxxxx
  • Date: Thu, 3 Aug 2017 13:59:29 +0800

Hi, Paul

Thank you for your reply.

Can you print `debug.getinfo(1,"S").source` to a file from your test.mcs
script to see what path is reported by the interpreter?
I got the following printout. it's just the correct path.
@C:/Users/Mixwind/Desktop/新建文件夹/test.mcs

I did some tests in this morning:
When I set the working directory to "C:/Users/Mixwind/Desktop/新建文件夹" then
run dofile("test.mcs") from official lua.exe, it worked fine. But if I
change the "test.mcs" to "测试.mcs" then it prompt
Debugging suspended at 'xB2xE2xCAxD4.mcs:5' (couldn't activate the file).

Then I created a new doc (default UTF8) in zerobrane and paste the above
message to it and save it to a txt file. I opened the file in emeditor the
message appeared as
Debugging suspended at '测试.mcs:5' (couldn't activate the file).
the codepage detected by the emeditor is 936.

It verified my previous guess. The original path or filename is encoded as
ANSI. During remote debugging, the path and filename encoded to UTF8 which
debugger cannot recognize and activate.

On Thu, Aug 3, 2017 at 11:44 AM, Paul K <paul@xxxxxxxxxxxxx> wrote:

Hi Sun Zhuo,

I guess windows encode Chinese characters as GBK and zerobrane encode to
UTF8?

Yes, it could be the reason for this. The debugging (both initiated
from the IDE and externally) works for me with Unicode (Chinese and
Russian) symbols in the file path, but my code page is 437. It looks
like you have already seen this ticket
(https://github.com/pkulchenko/ZeroBraneStudio/issues/559), which has
related discussion.

It does seem like there is some strange character conversion in this
case, which I don't have explanation for, but I can say that the
debugger shows the path (c:/users/mixwind/desktop/싐ꢽ쓎ﺼ킼//test.mcs) as
reported by the Lua engine (with some casing changes, but not much
else). Can you print `debug.getinfo(1,"S").source` to a file from your
test.mcs script to see what path is reported by the interpreter?

Paul.

On Wed, Aug 2, 2017 at 9:23 AM, SUN Zhuo <mixwind@xxxxxxxxx> wrote:
I created a folder named "新建文件夹" on windows desktop and tried to use
remote
debugging. Then the zerobrane prompted the following:

Debugging suspended at 'c:/users/mixwind/desktop/싐ꢽ쓎ﺼ킼//test.mcs:1'
(couldn't activate the file).

I guess windows encode Chinese characters as GBK and zerobrane encode to
UTF8?


Other related posts: