Page 2 of 2
Re: file name is urlEncoded ?
Posted: Sun Jan 06, 2013 4:33 pm
by Mark
I'm not asking about the files but about the file paths.
Mark
Re: file name is urlEncoded ?
Posted: Sun Jan 06, 2013 8:41 pm
by jacque
Mark, yes, you're right that my function will not work for everything, but yours won't either. There isn't any good way to know if the special characters are intended to be part of the name or not. I'm not clear why it matters where the files come from; if they are saved to disk with special characters the script needs to deal with them.
Your method has the same issues as mine. If the file name really does contain special characters then its existence will be reported as true and your method will return false (not encoded). I'm not sure the problem is completely solveable. Checking a list of specific characters won't work either for the same reason, there's no way to know if the character was intended or part of an encoded name.
Re: file name is urlEncoded ?
Posted: Sun Jan 06, 2013 9:08 pm
by jacque
jmburnod, thinking about this more, maybe the real question is "why do you need to know?" If you are just working with files, then their name on disk is their "real" file name. Using that file name allows access to the file (read/write) and any lists the stack needs to display will be accurate representations of what is on disk. If we know why decoding is necessary, maybe there is a different way to solve it.
Re: file name is urlEncoded ?
Posted: Mon Jan 07, 2013 12:29 am
by jmburnod
Hi,
Jacques,
why do you need to know ?
Users should be able to add files that come from a server or from his owner desktop or device machine and it is possible to have urlencoded files or not.
Mark
Where come the files from ?
The files come from my iPad or zip archive in the alternatic server or the user's computer
There are urlencoded because that is a way that I found to keep the diacritical chars of a filename in a .zip archive.
Kind regards
Jean-Marc
Re: file name is urlEncoded ?
Posted: Mon Jan 07, 2013 3:45 am
by jacque
jmburnod wrote:
Users should be able to add files that come from a server or from his owner desktop or device machine and it is possible to have urlencoded files or not.
Hm. Would it be safe to assume that you should decode files from a remote server or device, but not from the local machine?
Re: file name is urlEncoded ?
Posted: Mon Jan 07, 2013 11:22 am
by jmburnod
Hi Jacque,
Code: Select all
Would it be safe to assume that you should decode files from a remote server or device, but not from the local machine?
Yes, if there is no solution to recognize a name of file encoded but it pushes away the problem farther: a user could have a file encoded on his hard disk
Re: file name is urlEncoded ?
Posted: Mon Jan 07, 2013 7:04 pm
by jacque
jmburnod wrote:
Yes, if there is no solution to recognize a name of file encoded but it pushes away the problem farther: a user could have a file encoded on his hard disk
True, but in that case the encoded name really is the name of the file. It will look the same in the OS (Finder or Explorer.)
It's an interesting question. Are you on the mailing list? Some of the people there may have ideas. If you aren't, I can ask for you and let you know.
Re: file name is urlEncoded ?
Posted: Mon Jan 07, 2013 7:15 pm
by jmburnod
Jacque wrote
Are you on the mailing list ?
No. Which is the procedure to appear to it ?
Re: file name is urlEncoded ?
Posted: Sat Jan 12, 2013 11:27 am
by jmburnod
Hi All,
I don't know what is the best place for this post (This one or a new topic in the IOS)
It concern the same mistake but on IOS
I remain a little confused with file name urlencoded
If a file name with space is urlEncoded on IOS
urlEncode("Céline est arrivée.txt") = "C%258Eline+est+arriv%8Ee.txt"
and the file name = "C%258Eline+est+arriv%8Ee.txt"
if not
"Céline est partie.txt" = "C%258Eline est arriv%8Ee.txt"
The diacritical char is urlEncoded but not the space char
Fortunately urlDecode("C%258Eline est arriv%8Ee.txt") = "Céline est arrivée.txt"
Best regards
Jean-Marc
Re: file name is urlEncoded ?
Posted: Sat Jan 12, 2013 8:31 pm
by jacque
jmburnod wrote:Jacque wrote
Are you on the mailing list ?
No. Which is the procedure to appear to it ?
Sorry, I just saw this. For some reason, "read new posts" didn't show me this last week. You can sign up for the mailing list here:
http://lists.runrev.com/mailman/listinfo/use-livecode/
I have had issues with iOS urlencoding too. Maybe someone on the mailing list knows more about it.
Re: file name is urlEncoded ?
Posted: Sun Jan 13, 2013 10:53 am
by jmburnod
Jacque said: You can sign up for the mailing list here:
Thank Jacque. I'll do that