Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Removing weird characters
Message
From
22/12/2009 09:22:11
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01440140
Message ID:
01440145
Views:
77
This message has been marked as a message which has helped to the initial question of the thread.
>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
lcFileName = "file2001abc5%9#<ƒ-@ ŠÊ<óŸumo]@.jpg"
lcGood ='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'

lcFName = Juststem(m.lcFileName)
lcExt = Justext(m.lcFileName)

? FORCEEXT( Chrtran(m.lcFName, Chrtran( m.lcFName, m.lcGood, '' ), ''), ;
 Chrtran(m.lcExt, Chrtran( m.lcExt, m.lcGood, '' ), ''))
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform