Hi All
I get a different results if i use name of file (by script or copy/paste from finder) or if I typed it directly in message box (OSX 10.13, LC indy 9.0)
Case name of file or copy/paste from finder
put urlencode("accordéon") = "accorde%3Fon"
Chartonum of "accordéon" = 97,99,99,111,114,100,63,111,110,46,112,110,103
Case name typed with keyboard in message box or from detailed files
put urlencode("accordéon") = "accord%8Eon"
Chartonum of "accordéon" = 97,99,99,111,114,100,142,111,110,46,112,110,103
It seems numtochar(63) = ? is used instead 142 = é
Does that what is expected ?
Best regards
Jean-Marc
Different results about urlencode(name of file) and detailed files
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Different results about urlencode(name of file) and detailed files
https://alternatic.ch
-
- VIP Livecode Opensource Backer
- Posts: 7235
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Different results about urlencode(name of file) and detailed files
I get the same results. When text is imported from outside LC it is usually necessary to textDecode it first, but that isn't working either. I'd submit a bug report.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Different results about urlencode(name of file) and detailed files
Thanks again Jacqueline,
I’m afraid I will lost my last hair about file name with accented letter.
It seems that is the same for folder name but as far i know there is not a "detailed folder".
I will test this quick and dirty solution creating a folder "FoldersNameToFilesName" which contains files with folder name and use "detailed files" to get the correct urlecoded name. (not sure i'm clear here).
Best regards
Jean-Marc
P.S: bad day with Klondike (760) but I learn a lot about addiction process
I’m afraid I will lost my last hair about file name with accented letter.
It seems that is the same for folder name but as far i know there is not a "detailed folder".
I will test this quick and dirty solution creating a folder "FoldersNameToFilesName" which contains files with folder name and use "detailed files" to get the correct urlecoded name. (not sure i'm clear here).
Best regards
Jean-Marc
P.S: bad day with Klondike (760) but I learn a lot about addiction process
https://alternatic.ch
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Different results about urlencode(name of file) and detailed files
This seems work
Code: Select all
on getCorrectUrlNameFolder
put "testUrlName" into tFolTest
put specialfolderpath("documents" ) & "/" & tFolTest into tPathFolTest
new folder tPathFolTest
put "préintermédiaire" into tNameFol
put tPathFolTest & "/" & tNameFol into tPathFol
new folder tPathFol
set the defaultfolder to tPathFolTest
put tPathFolTest & "/" & tNameFol & ".txt" into tNameFile
put "test" & the ticks into url("file:" & tNameFile)
set the defaultfolder to tPathFolTest
put the files into tFiles
filter tFiles without ".DS_Store*"
put the detailed files into tDetFiles
filter tDetFiles without ".DS_Store*"
put urlEncode(char 1 to -5 of tFiles) into tUrlNameFromTheFiles
put char 1 to -5 of item 1 of tDetFiles into tUrlNameFromTheDetFiles
put "UrlNameFromTheFiles = " && tUrlNameFromTheFiles & cr & "UrlNameFromTheDetFiles = " && tUrlNameFromTheDetFiles
end getCorrectUrlNameFolder
https://alternatic.ch