I agree with this approach. On the formpage, tell the user that the field must non-accented alphanumeric, and an=y other characters will be stripped out. Justlike the thousands of username and password fields throughout the interne=t have certain restrictions. Leave it on theuser to enter the info correctly. Then just run Donovan's grep routine to= make sure it's clean. If you try toaccommodate every possible character someone will throw at you, you'll su=rely miss something.
Terry
On Mon, 15 Feb 2010 13:16:07 -0600
DonovanBrooke <dbrooke@euca.us> wrote:
> Lawrence wrote:
>>= hi,
>> here is myproblem...
>> I need to create folders on the server using a nam=e the
>>clients save
>>through a form. Then clients upload images, and the
>>Imagemagi=ck make its
>> manipulations. (noproblem yet)
>> My problem is if people use non ASCII caracters =like :
>>=C3=A9=C3=A0=C3=AF or<spaces>
>> Because then
[movefile] won't process, so neit=her
>>Imagemagik...
>>
>> So I created a database to convert chars
>> =C3=A0=3D=a; =C3=AF=3Di; =C3=A9=3De
>> but when I apply the asciiconvert I get very strange
>>character back
>> like := i=EF=BF=BDi=EF=BF=BDi=EF=BF=BDi=EF=BF=BD
>> I use UTF8 encoding= inthe pages and the same for the
>>database.
>> I tried =to append the name of the folder in the db
>>replacing the non
>> ascii characters
>> &=amp;regate_url=3D[ConvertChars
>>db=3D^ascii.db][Nom_regate][/ConvertChars]
>> but in=stead of =C3=AF=C3=B4=C3=A9=C3=A0 I have in the db:i=EF=BF=BDi=EF=BF=BDi=EF==BF=BDi=EF=BF=BD and I
>>would like ioea...
>>
>> I found a solutio=n using
[grep] but it's not very clean,
>>and I need to
>> apply plenty of
[grep] for each ki=nd of character...
>>
>> Asany body got an idea of what can be wrong or any
>>other soluti=on...
>> Thanks
>>Lawrence
>
> what about simply something like:
>
&=gt; [grep search=3D[^A-Za-z_-]&replace=3D][fnames][/grep]
>
>For cleaning your input.
> Donovan
>
> --
=> Donovan Brooke
> Euca DesignCenter
> [Practical-Ethical-Efficient]
> www.euca.us
> =egg.bz
> artglass-forum.com
>---------------------------------------------------------
> This me=ssage is sent to you because you are subscribed
>to
> the mailing list <talk@webdna.us>.
> To un=subscribe, E-mail to:<talk-leave@webdna.us>
> archives: http://mail.webdna.us/list=/talk@webdna.us
> old archives:http://dev.webdna.us/TalkListArchive/
> Bug Reporting:
>http=://forum.webdna.us/eucabb.html?page=3Dtopics&category=3D288
=C2==A0