Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


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