Heres a couple of subs i use to uri encode - but you can easily change them
to do whatever you want with certain characters

 

001:    SUBROUTINE URIENCODE(url)

002: * Sub to uri encode a url

003:

004:    max=LEN(url)

005:    newurl=''

006:

007:    FOR i = 1 TO max

008:       thischar = url[i,1]

009:       IF SEQ(thischar)>126 THEN

010:          thischar="%":DTX(SEQ(thischar))

011:       END

012:       newurl := thischar

013:    NEXT i

014:

015:    url=newurl

016:

017:    RETURN

 

 

001:    SUBROUTINE FULL.URIENCODE(url)

002: * Sub to fully uri encode all characters in a url except 0-9 and a-z

003:

004:    max=LEN(url)

005:    newurl=''

006:

007:    FOR i = 1 TO max

008:       thischar = url[i,1]

009:       thischar.seq=SEQ(thischar)

010:       IF NOT((thischar.seq>47 AND thischar.seq<58) OR (thischar.seq>64
AND thischar.seq<91) OR (thischar.seq>96 AND thischar.seq<123)) THEN

011:          thischar="%":DTX(SEQ(thischar))

012:       END

013:       newurl := thischar

014:    NEXT i

015:

016:    url=newurl

017:

018:    RETURN

 

 

 

From: [email protected]
[mailto:[email protected]] On Behalf Of Jeff Schasny
Sent: 12 January 2011 14:58
To: U2 Users List
Subject: Re: [U2] Special Character Handling

 

I don't know of an existing tool, probably because it depends on what
you consider a 'special' character. Are line feeds and carriage returns
OK? How about tab?

If you only want 'printable' characters then loop through each character
in the file:

IF SEQ(CHARACTER) > 31 AND SEQ(CHARACTER) < 127 THEN...

Ron Hutchings wrote:
> Is there a tool to remove special characters from a text file?  Other than
a roll your own with convert or replace in a program?
>                                        
> _______________________________________________
> U2-Users mailing list
> [email protected]
> http://listserver.u2ug.org/mailman/listinfo/u2-users
>
>  

--
------------------------------------------------------------------------
Jeff Schasny - Denver, Co, USA
jschasny at gmail dot com
------------------------------------------------------------------------
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users 

  _____  

No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1191 / Virus Database: 1435/3374 - Release Date: 01/11/11

_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to