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:

OrderFile (2000) PDF (1999) Help! WebCat2 bug (1997) variables in or out of includes (2001) What are SMSI's upgrade policies? (2003) Wanted: More Math Functions (or, Can You Solve This?) (1997) Question about Webcatalog and Webstar for Mac OS X (1998) Cancel Subscription (1996) Dreamweaver Integration (1998) [OT] JS snippet needed (2006) WebDelivery downloads alias, not original ? (1997) WebCat2 beta 11 - new prefs ... (1997) Search results templates (1996) [WebDNA] WebDNA & Facebook (2011) Modifying order output (1997) All choices on IE different than Netscape (1997) related data (2003) emailer w/F2 (1997) Country & Ship-to address & other fields ? (1997) WC2b15 File Corruption (1997)