---
name: "ns_urlencode"
section: "3aolserver"
platform: "linux"
package: "aolserver4-dev"
version: "4.5.1-18.1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/ns_urlencode/3aolserver"
---

# ns\_urlencode(3aolserver)

URL encode a string.

```

```

## NAME

ns\_urlencode - URL encode a string.

## SYNOPSIS

**ns\_urlencode** *string*

```

```

## DESCRIPTION

Encodes given string according to the encoding defined in RFC #1738, Uniform Resource Locators.  The command encodes all non-alphanumeric characters in data. The encoding for a character is a "%" followed by the two-character hexadecimal representation for the character.

## EXAMPLE

The following command:

```
ns_urlencode "http://www.aolserver.com/redirect.adp?url=http://www.aol.com&t=1,2,3"
```

returns:

```
http%3a%2f%2fwww%2eaolserver%2ecom%2fredirect%2eadp%3furl%3dhttp%3a%2f%2fwww%2eaol%2ecom%26t%3d1%2c2%2c3
```

## SEE ALSO

ns\_urldecode(n)

## KEYWORDS

encoding, url
