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

  • From: SUN Zhuo <mixwind@xxxxxxxxx>
  • To: zerobrane@xxxxxxxxxxxxx
  • Date: Fri, 4 Aug 2017 12:36:01 +0800

I temporarily solved it.
I found this lib (https://github.com/nivrrex/LuaUnicode) and made a
unicode.dll and put it into bin/clibs of zerobrane.
Then I modified the debugger.lua (in src/editor) by adding "f =
require('unicode').a2u8(f)" at line 950 in the function
"debugger:loadfile(file)"
Then all things work"

I think the reason is that zerobrane try to read a UTF-8 filename whilst
lua sent a ANSI filename.
Thank you for your great editor, I am looking forward your better solution.

On Thu, Aug 3, 2017 at 3:09 PM, SUN Zhuo <mixwind@xxxxxxxxx> wrote:


By "official lua.exe" do you mean the one included with the IDE or the
one you downloaded from lua.org?

I tested both of them.

By "worked fine" do you mean that the debugging started as expected
and worked with that file name?

I mean worked as expected. It worked only when the argument of the
'dofile' function does not contain any Chinese character.

But if I change the "test.mcs" to "测试.mcs" then it prompt
Debugging suspended at 'xB2xE2xCAxD4.mcs:5' (couldn't activate the
file).
What does `debug.getinfo(1,"S").source` show in this case?

It shows @测试.mcs.

Also, how do you run the files from the IDE and what do you see in the
Output window?

the "测试.mcs" can be run from the IDE and worked fine. see blow:

Program starting as '"C:\Users\Mixwind\Desktop\ZeroBrane\bin\lua.exe" -e
"io.stdout:setvbuf('no')" "C:\Users\Mixwind\AppData\
Local\Temp\.31A9.tmp"'.
Program 'lua.exe' started in 'C:\Program Files 
(x86)\MicroCity\scripts\myprograms'
(pid: 5900).
Debugging session started in 'C:\Program Files (x86)\MicroCity\scripts\
myprograms\'.
@C:\Users\Mixwind\Desktop\新建文件夹\测试.mcs
Program completed in 1.67 seconds (pid: 5900).
Debugging session completed (traced 0 instructions).

I tested similar setup and in my case it all works on Windows 8.1, but
mostly because the IDE is using short file names: the path reported by
the Lua interpreter looks like
`@D:\something\something\E728~1\85A1~1.LUA`.

I tested on three computers which are all installed windows 10 and acted
as the same. I think the mobdebug lib cause the problem.


Other related posts: