Page 1 of 1

I need help with xFF!

Posted: Sun Apr 05, 2015 1:11 pm
by zhek0s
Hi every one. Im have very big problem(maybe only for me).
My project needs input from cmd.exe, but it have some problems with numbers like 2xFF048 on utf-8 encoding without BOM.
utf-8.lua and libraries like them dont help.
Help me please.

Re: I need help with xFF!

Posted: Sun Apr 05, 2015 1:38 pm
by s-ol
zhek0s wrote:Hi every one. Im have very big problem(maybe only for me).
My project needs input from cmd.exe, but it have some problems with numbers like 2xFF048 on utf-8 encoding without BOM.
utf-8.lua and libraries like them dont help.
Help me please.
Well, show us your code and the exact problem you ran into.

Re: I need help with xFF!

Posted: Mon Apr 06, 2015 3:26 pm
by zhek0s
n = os.tmpname ()
os.execute ("chcp 437")
os.execute ("tasklist > " .. n)
for line in io.lines (n) do
text[#text+1]=line
print(line)
end
end
os.remove(n)

Re: I need help with xFF!

Posted: Mon Apr 06, 2015 5:09 pm
by zhek0s
I need some systeminfo. I have trubles with numbers that cmd.exe returns, for exemple: 2xFF048 KB (you can see it when set encoding on notepad to utf-8 without BOM).
if i run something like os.execute("help >"..n), no errors and normal text.
Really dont know what to do...

Re: I need help with xFF!

Posted: Mon Apr 06, 2015 7:15 pm
by s-ol
zhek0s wrote:I need some systeminfo. I have trubles with numbers that cmd.exe returns, for exemple: 2xFF048 KB (you can see it when set encoding on notepad to utf-8 without BOM).
if i run something like os.execute("help >"..n), no errors and normal text.
Really dont know what to do...
And what is the error you are experiencing?

Re: I need help with xFF!

Posted: Tue Apr 07, 2015 8:12 pm
by zhek0s
line 27: Decoding error: invalid utf-8
At line 27 i have lg.print(text)