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:

Header values are not accepted (1998) Is there a 'does not contain' comparison? (1999) Weird problems with [SHOWIF]s (1997) Meet your competition (2000) Mozilla/4. and Browser Info.txt (1997) Ready to h[url]!!! (1999) New Command prefs ... (1997) Looking for WebCat Guru (2000) Nesting format tags (1997) WebCatalog NT beta 18 now available (1997) Append command (2000) Help! WebCat2 bug (1997) Security Issues and WebCommerce Solution (1997) First postarg not taking in $Commands (1997) [OT] Theiving B*****ds (2004) problems with 2 tags shakur (1997) Virtual hosting and webcatNT (1997) Duplicates (1998) Random Number Generator works for Ranges of Numbers (1997) emailer (1997)