Re: [WebDNA] [convertchars] and ascii problem

This WebDNA talk-list message is from

2010


It keeps the original formatting.
numero = 104742
interpreted = N
texte =
I agree with this approach. On the form page, tell the user that the field must non-accented alphanumeric, and an= y other characters will be stripped out. Just like the thousands of username and password fields throughout the interne= t have certain restrictions. Leave it on the user to enter the info correctly. Then just run Donovan's grep routine to= make sure it's clean. If you try to accommodate every possible character someone will throw at you, you'll su= rely miss something.
Terry

On Mon, 15 Feb 2010 13:16:07 -0600
Donovan Brooke <dbrooke@euca.us> wrote:
> Lawrence wrote:
>>= hi,
>> here is my problem...
>> 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. (no problem 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 ascii convert I get very strange
>>character back
>> like := i=EF=BF=BDi=EF=BF=BDi=EF=BF=BDi=EF=BF=BD
>> I use UTF8 encoding= in the 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...
>>
>> As any 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 Design Center
> [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
Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] [convertchars] and ascii problem [solved] (Lawrence 2010)
  2. Re: [WebDNA] [convertchars] and ascii problem (Donovan Brooke 2010)
  3. Re: [WebDNA] [convertchars] and ascii problem ("Terry Wilson" 2010)
  4. Re: [WebDNA] [convertchars] and ascii problem (Donovan Brooke 2010)
  5. Re: [WebDNA] [convertchars] and ascii problem (Tom Duke 2010)
  6. Re: [WebDNA] [convertchars] and ascii problem (Lawrence 2010)
  7. Re: [WebDNA] [convertchars] and ascii problem (Tom Duke 2010)
  8. Re: [WebDNA] [convertchars] and ascii problem (Lawrence 2010)
  9. [WebDNA] [convertchars] and ascii problem (Lawrence 2010)
I agree with this approach. On the form page, tell the user that the field must non-accented alphanumeric, and an= y other characters will be stripped out. Just like the thousands of username and password fields throughout the interne= t have certain restrictions. Leave it on the user to enter the info correctly. Then just run Donovan's grep routine to= make sure it's clean. If you try to accommodate every possible character someone will throw at you, you'll su= rely miss something.
Terry

On Mon, 15 Feb 2010 13:16:07 -0600
Donovan Brooke <dbrooke@euca.us> wrote:
> Lawrence wrote:
>>= hi,
>> here is my problem...
>> 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. (no problem 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 ascii convert I get very strange
>>character back
>> like := i=EF=BF=BDi=EF=BF=BDi=EF=BF=BDi=EF=BF=BD
>> I use UTF8 encoding= in the 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...
>>
>> As any 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 Design Center
> [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
"Terry Wilson"

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Thanks and Big News!!! (1997) Launch date and time? (1999) Email Format (Umlaut) (2004) Beta Documentation (1997) Quit revisited (1997) why is this line in GeneralStore? (1998) Users.db (1998) [url] (1997) $Append for Users outside the ADMIN group (1997) [WebDNA] WebDNA restart script (2015) AmEx, shipping (2000) Item order (2002) Part Html part WebDNA (1997) Close Databases Crash? (1998) Running _every_ page through WebCat ? (1997) Almost a there but..bye bye NetCloak (1997) WebCat b13 CGI -shownext- (1997) Running 2 two WebCatalog.acgi's (1996) Newbie questions (1998) [WebDNA] Need Rosetta to install on OS X? (2010)