spacer
Yehuda Shiran May 7, 2000
ASCII-URI Conversions
Tips: May 2000

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs

The URI (Universal Resource Index) is a standard format for specifying resources over the Internet. The principle behind this standard is that all its member characters are alphanumeric. All non-alphanumeric characters are replaced by a string in the form of "%xy" where xy being the ASCII encoding of the non-alphanumeric character. The target set of characters belong to to the ISO Latin-1 character set. The ISO Latin-1 (8859-1) is the standard set of characters used over the Internet. Only this standard is guaranteed to be supported on a Web site.

Internet Explorer 5.5 introduced four new methods to encode strings to URIs as well as to decode URIs to strings. The first method, encodeURI(string), encodes a string as a full URI. Let's take an example. The following line:

encodeURI("My phone # is 123-456-7890")); 

should generate the following string:

My%20phone%20#%20is%20123-456-7890

The other three methods are encodeURIComponent(), decodeURI(), and decodeURIComponent(). Read all about them in Column 59, IE 5.5: Formatting, URIs, and Stack Operations.


People who read this tip also read these tips:

Look for similar tips by subject:

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint