Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Removing weird characters
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01440140
Message ID:
01440144
Vues:
115
This message has been marked as the solution to the initial question of the thread.
lcDigits = "0123456789"
lcLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
lcSpecial = " _-"
lcAllowedChars = lcDigits + lcLetters + LOWER(lcLetters) + lcSpecial
lcValue = "file2001abc5%9#<ƒ-@ ŠÊ<óŸumo]@.jpg"

? CHRTRAN(lcValue, CHRTRAN(lcValue, lcAllowedChars, ""), "") 
Or you can remove invalid charcters based on http://www.berezniker.com/content/pages/visual-foxpro/determine-invalid-characters-file-name-and-path

>I use my own software to manage my emails
>
>When I save attachments I use the file name I get from the server to name the file to be saved
>
>But sometimes the file name has weird caracters as below,
>and it results in error when saving the file
>
>
>
>
> file2001abc5%9#<ƒ-@ ŠÊ<óŸumo]@.jpg
>
>
>
>
>Is there anyway to remove all strange chars and keep only a-z and 0-1 chars ?
>
>I tried CHRTRAN( ) but it's impossible to predict what strange char I will receive
>
>I dont need to replace the weird char, just delete it
>
>Moises
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform