Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Find a valid Name of Folder
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01288621
Message ID:
01288738
Views:
14
*---------------------------------------------------------------------------------
* ut 02/2008 TRouver un nom valide pour enregister le compagnyName
FUNCTION ValidFolderName(lcFolderName)

LOCAL lcBadChars 
lcBadChars = [\/:*?"<>|] && Add all chars you want to remove here
lcFolderName = CHRTRAN(lcFolderName,lcBadChars,[])
DO WHILE AT([  ], lcFolderName) # 0 && Remove all double spaces
   lcFolderName = STRTRAN(lcFolderName,[  ],[ ])
ENDDO

lcFolderName = CHRTRAN(lcFolderName,[ ],[_])
lcFolderName = CHRTRAN(lcFolderName,[é],[e])
lcFolderName = CHRTRAN(lcFolderName,[è],[e])
lcFolderName = CHRTRAN(lcFolderName,[ê],[e])
lcFolderName = CHRTRAN(lcFolderName,[à],[a])
lcFolderName = CHRTRAN(lcFolderName,[â],[a])
RETURN lcFolderName
This code seems to work ...



>

>FUNCTION ValidFolderName(lcFolderName)
>
>LOCAL lcBadChars
>lcBadChars = [\/:*?"<>|] && Add all chars you want to remove here
>lcFolderName = CHRTRAN(lcFolderName,lcBadChars,[])
>DO WHILE AT([ ], lcFolderName) # 0 && Remove all double spaces
> lcFolderName = STRTRAN(lcFolderName,[ ],[ ])
>ENDDO
>
>RETURN CHRTRAN(lcFolderName,[ ],[_])
>
>
>It depends what encoding is used.
>If I open that link, maybe I will see something like:
>http:/.../R%43sidence...
>Where %43 is the code for [é] - THIS IS NOT THE ACTUAL CODE, just an example.
>I am not sure at all how to avoid that.
>Somebody with more HTTP skills must be involved here :-)
>
>
>
>
>>Naomi
>>Borisslav,
>>
>>Thank for your answer...
>>
>>

>>*---------------------------------------------------------------------------------
>>* UT 02/2008 Borislav Borissov Trouver un nom valide pour enregister le compagnyName
>>FUNCTION ValidFolderName(lcFolderName)
>>
>>LOCAL lcBadChars
>>lcBadChars = [\/:*?"<>|] && Add all chars you want to remove here
>>lcFolderName = CHRTRAN(lcFolderName,lcBadChars,[])
>>DO WHILE AT([ ], lcFolderName) # 0 && Remove all double spaces
>> lcFolderName = STRTRAN(lcFolderName,[ ],[ ])
>>ENDDO
>>
>>DO WHILE AT([ ], lcFolderName) # 0 && Remove all double spaces
>> lcFolderName = STRTRAN(lcFolderName,[ ],[_])
>>ENDDO
>>
>>RETURN lcFolderName
>>

>>
>>
>>
>>But i have still a problem ....:)
>>
>>"Residence" is not the same that "Résidence" !
>>What is the caracters not allowed in IE ?
>>Aie !
>>
>>What can i do ?
>>
>>bernhart
>>
>>
>>>>Borislav,
>>>>
>>>>I have still a strange problem.
>>>>
>>>>I send a fich on Ftp server. ( it is really on FTP server )
>>>>
>>>>

>>>>www.LesBouleaux.com/Amline/73255388-Résidence A La Belle Fleur/20080203_161138_DATA2_03_11.zip
>>>>

>>>>It becomes in internet explorer
>>>>

>>>>http://www.lesbouleaux.com/Amline/73255388-Résidence%20A%20La%20Belle%20Fleur/20080203_161138_DATA2_03_11.zip
>>>>

>>>>
>>>>What happend ?
>>>>
>>>>Good evening
>>>>
>>>>
>>>>bernhart
>>>
>>>%20 is code for CHR(32) - space. That is how HTTP works.
>>>As Naomi said you could use underscore to replace spaces.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform