Jump to content
Sign in to follow this  
Andrew Sparkes

A function to escape/encode a URL string ?

Recommended Posts

Andrew Sparkes

I hunted through the beta's helpfile and did a number of searches here, but have found nothing... What I need is a function to escape a string (using % as escape char) so it can pass nicely into a GET request. It has the same function as escape() in Javascript, but I need it in autoit. I can do it myself, but I was wondering if someone had already done it. If no one has done it, I'll use www.w3schools.com's reference and put the final function in scripts and scraps...

i.e. turning







Share this post

Link to post
Share on other sites
Andrew Sparkes

I thought it was too easy of a problem to wait for it, so I wrote my own:

Tell me if there are any problems, it should work right... it escapes all characters that aren't alphanumeric or a period.

Func URLEscape($text)
    For $x=1 To StringLen($text)
        If StringRegExp($char,'\A|\.',0) Then
    Return $newtext


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.