PDA

View Full Version : encodeURIComponent and strfind problem



Tetsuo Shima
November 25th, 2004, 02:58 PM
Hy there,

well, don't ask why but I got a text like that:


http://kaneda:81/index.html?C:%5CDOKUME~1%5CTETSUO~1%5CEIGENE~2%5CA LTERN~1%5C01-11-~1.MP3

and then I got a LUA-Code like:


if strfind(pld1,"%5C") then
temp = gsub (tostring(pld1) ,"%5C","\\")
execute(start".." ".."C:\\Programme\\Winamp\\winamp.exe".." "..temp)
else
result = 0
end

If I replace the %5C (I think you get it that this is the URI placeholder for a slash) with e.g. "xHHHx" it works.
It's important that it's %5C. How can I handle the percent-sign in a strfind?

Greets
Tetsuo

Promixis
November 25th, 2004, 04:34 PM
Tetsuo, the % is a special character in lua strings. I think %% = % but you will have to check the lua docs in the top post in this forum.