WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Winsock
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

URL Encoding

The syntax of URLs is formally defined in RFC 1738.

Not all ASCII characters are permitted in URLs.

Non-permissible characters, such as `<' and `>', and characters that have a special meaning, such as `/' and `:', must be encoded by a percent sign (`%') followed by two hexadecimal digits (0--9, A--F) giving the ordinal value for that character in the ISO 8859 character set.

The table shows a number of common encodings.
Note that encoding and decoding is quite straightforward.

 

	+	%2B
	&	%26
	=	%3D
	/	%2F
	~	%7E
	%	%25
       space   	%20

Sample Code for encoding data part of URL's

;Encoding sample code
Line=AskLine("Enter your line","Right here","A Sample Line")

line=strreplace(line,"%","%25")  ;MUST DO %'s first !!!
line=strreplace(line," ","%20")
line=strreplace(line,"~","%7E")
line=strreplace(line,"/","%2F")
line=strreplace(line,"=","%3D")
line=strreplace(line,"&","%26")
line=strreplace(line,"+","%2B")

Message("Encoded line is",line)

Article ID:   W12606
Filename:   Encoding URLs.txt
File Created: 2017:07:28:13:58:50
Last Updated: 1999:04:15:16:48:22