Closed jjvbsag closed 4 years ago
The same is true for wxDir. Change the end of the script above to
--
-- now try
--
local d=wx.wxDir(".")
local ok,entry=d:GetFirst('*',wx.wxDIR_FILES)
while ok do
printf("FILES entry=%s\n",vis(entry))
ok,entry=d:GetNext()
end
the output is
FILES entry="test-wx-execute.lua"
FILES entry="iso-\xf4\x80\x82\xa0\xf4\x80\x82\xa8\xf4\x80\x82\xb2.txt"
FILES entry="test-wx-dir.lua"
FILES entry="ascii-abc.txt"
FILES entry="utf-\xc3\xa0\xc3\xa8\xc3\xb2.txt"
but I expected to get
FILES entry="test-wx-execute.lua"
FILES entry="iso-\xa0\xa8\xb2.txt"
FILES entry="test-wx-dir.lua"
FILES entry="ascii-abc.txt"
FILES entry="utf-\xc3\xa0\xc3\xa8\xc3\xb2.txt"
This is an issue of wxWidgets, not lua. Because, when I change the script ending to
--
-- now try
--
require"lfs"
for entry in lfs.dir(".") do
printf("FILES entry=%s\n",vis(entry))
end
I get the expected:
FILES entry="test-wx-execute.lua"
FILES entry="iso-\xa0\xa8\xb2.txt"
FILES entry="test-wx-dir.lua"
FILES entry="test-lfs-dir.lua"
FILES entry="."
FILES entry="ascii-abc.txt"
FILES entry="utf-\xc3\xa0\xc3\xa8\xc3\xb2.txt"
FILES entry=".."
@jjvbsag, I'm not sure what's going on, but I can't reproduce these results on Windows and everything looks good to me there.
I created a file using Russian unicode characters (привет.lua
). This is how it's reported by dir
command on my machine:
12/08/2019 22:12 1,431 ascii-stdout.lua
12/08/2019 20:30 11 привет.lua
When I run this script that is using wxDir and lfs, I get the following results:
wxdir=ascii-stdout.lua
wxdir=привет.lua
lfs=ascii-stdout.lua
lfs=??????.lua
Here is the script:
require "wx"
local function getDir(path)
local dir = wx.wxDir()
dir:Open(path)
local found, file = dir:GetFirst("*", wx.wxDIR_FILES)
while found do
printf("wxdir=%s\n",file)
found, file = dir:GetNext()
end
dir:Close()
end
getDir('.')
require"lfs"
for entry in lfs.dir(".") do
printf("lfs=%s\n",entry)
end
As you can see, the results returned by wxDir are the correct ones. I'm not sure if this is somehow related to the OS differences and will try to test on Linux as well, but so far I don't see an issue with the wxwidgets code.
Closing this one, as I don't see what can be done about this one. Please update if there is new information.
Triggered by my Subversion Plugin I have problems with
wxExecuteStdoutStderr
, if stdout has utf8 (or more precise, none-ascii) characters within. To verify it, I wrote the following script:The output I get is:
The output of
ls | cat
on the command line isSo you can see, the output returned in stdout of wxExecuteStdoutStderr has issues.
all of this with ZBS-1.80 on xubuntu 18.04.1 LTS