% characters in html code

J

jrefactors

In html code, I always see % characters such as following:
<a
href="mailto:[email protected]?subject=Business%20Applications%20Consultant%20%2d%2d%20Learn%20Oracle%20ERP%20%20%28san%20jose%20north%29">

But the outlook can understand it and interpret it as following when
i click the hyperlink:

Business Applications Consultant -- Learn Oracle ERP (san jose north)

My question is what are those % characters?
Please advise. thanks!!
 
J

Jan Faerber

(e-mail address removed):::[email protected]:::Monday 21 February 2005
In html code, I always see % characters such as following:
<a
href="mailto:[email protected]?subject=Business%20Applications%20Consultant%20%2d%2d%20Learn%20Oracle%20ERP%20%20%28san%20jose%20north%29">

But the outlook can understand it and interpret it as following when
i click the hyperlink:

Business Applications Consultant -- Learn Oracle ERP (san jose north)

My question is what are those % characters?
Please advise. thanks!!

We can look that up in a good book:

That is encoding of URL data.

%HH is an encoded character where HH is the hexadecimal acii-Value of this
character / sign.

The basics for this transformation can be found in the RFC 1738 that means
that all signs / characters will be transformed except alphanumeric signs,
the fullstop ".", the underscore "_" and the minus "-".

In historical ways the "+" is used for an empty space sign which does not
conform to the RFC 1738.

This relates to the functions rawurldecode / rawurlencode / urldecode /
urlencode in PHP.
 
J

Jukka K. Korpela

Jan Faerber said:
The basics for this transformation can be found in the RFC 1738

Haven't you heard that the said RFC was obsoleted, as far as generic URL
syntax is considered (and this _is_ about generic URL syntax), by RFC 2396
about six and a half years ago? This particular thing wasn't changed, but
it's still odd to avoid consulting the current specification.
In historical ways the "+" is used for an empty space sign which does
not conform to the RFC 1738.

No, encoding a space as "+" was and is prescribed for encoding _form data_
according to HTML specifications, before applying URL encoding.
 
J

jrefactors

Jukka said:
Haven't you heard that the said RFC was obsoleted, as far as generic URL
syntax is considered (and this _is_ about generic URL syntax), by RFC 2396
about six and a half years ago? This particular thing wasn't changed, but
it's still odd to avoid consulting the current specification.


No, encoding a space as "+" was and is prescribed for encoding _form data_
according to HTML specifications, before applying URL encoding.

so how do we decode it? any algorithms out there? any tutorials i can
look up?

please advise. thanks!!
 
J

Jukka K. Korpela

so how do we decode it? any algorithms out there?

The URL encoding is publicly defined in RFC 2396, as mentioned, and it is
fairly trivial to decode it on the basis of the definition. But unless you
need a simple programming exercise, find a library routine for the purpose.
It's probably named something like "decode" or "URLdecode". But if you are
using a high-level package, such as CGI.pm for processing form data (in a
format that includes URL encoding), you will find that the package's tools
automagically give the decoded data for you, unless you specifically want
to read the encoded version using lower-level routines.
any tutorials i can look up?

Use the tutorial for the server-side technology you are using, and if
problems remain, consider asking in a group that is most closely devoted to
that technology.
 
J

Jan Faerber

Jukka K. Korpela ... output:
Haven't you heard that the said RFC was obsoleted, as far as generic URL
syntax is considered (and this _is_ about generic URL syntax), by RFC 2396
about six and a half years ago? This particular thing wasn't changed, but
it's still odd to avoid consulting the current specification.

That is interesting. It is completly new to me. 2396 is derived from 1738
and 1808: http://www.faqs.org/rfcs/rfc2396.html

The book that I cited was "PHP 4 - Webserverprogrammierung unter Linux und
Windows": webserverprogramming under linux and windows
author: Jörg Krause
(c) 2003 Carl Hanser Verlag München Wien - Munic Vienna

http://www.php.comzept.de
http://www.phparchiv.de

No, encoding a space as "+" was and is prescribed for encoding _form data_
according to HTML specifications, before applying URL encoding.

Yes, for (... http://at.php.net/manual/en/function.urlencode.php ...)
application/x-www-form-urlencoded media type.
But here they use it for URLs in a "convenient way to pass variables to the
next page".

So you want to say that you will never find this in Outlook Express.
 
J

Jukka K. Korpela

Jan Faerber said:
Yes, for (... http://at.php.net/manual/en/function.urlencode.php ...)
application/x-www-form-urlencoded media type.
But here they use it for URLs in a "convenient way to pass variables to
the next page".

"It"? You mean the plus sign? Well they can use it the way they like, but
it's odd - the common convention is to use "&", and the age-old
recommendation is to use ";", but they probably wanted to apply the
NIH principle (Not Invented Here).
So you want to say that you will never find this in Outlook Express.

I have no idea what made you think so. I didn't say a word about Outlook
Express, and I don't know how OE would relate to anything in this issue.
 
J

Jan Faerber

Jukka K. Korpela ... output:
"It"? You mean the plus sign? Well they can use it the way they like, but
it's odd - the common convention is to use "&", and the age-old
recommendation is to use ";", but they probably wanted to apply the
NIH principle (Not Invented Here).

Yes: the "+" sign. Isn't it "%20" in %HH form for the empty space? But good
that you might mention more than one possibility!
I have no idea what made you think so. I didn't say a word about Outlook
Express, and I don't know how OE would relate to anything in this issue.

..oO(Because "+" is 'only' for forms...)
..oO(... and the "+" does not conform to the RFC 1738.)

Therefore I thought that OE won't use it ... after your informative posting.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top