Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   HTML (http://www.velocityreviews.com/forums/f31-html.html)
-   -   % characters in html code (http://www.velocityreviews.com/forums/t161031-characters-in-html-code.html)

jrefactors@hotmail.com 02-21-2005 05:06 PM

% characters in html code
 
In html code, I always see % characters such as following:
<a
href="mailto:hello@mail.com?subject=Business%20App lications%20Consultant%20%2d%2d%20Learn%20Oracle%2 0ERP%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!!


Jan Faerber 02-21-2005 05:41 PM

Re: % characters in html code
 
jrefactors@hotmail.com:::jrefactors@hotmail.com:::Monday 21 February 2005
18:06:::<1109005578.858206.52940@z14g2000cwz.googl egroups.com>:::alt.html
.... output:

> In html code, I always see % characters such as following:
> <a
>

href="mailto:hello@mail.com?subject=Business%20App lications%20Consultant%20%2d%2d%20Learn%20Oracle%2 0ERP%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.


--
Jan

http://html.janfaerber.com

Jukka K. Korpela 02-21-2005 09:51 PM

Re: % characters in html code
 
Jan Faerber <jan.faerber@prioritytelecom.biz> wrote:

> 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.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html



jrefactors@hotmail.com 02-22-2005 02:17 AM

Re: % characters in html code
 

Jukka K. Korpela wrote:
> Jan Faerber <jan.faerber@prioritytelecom.biz> wrote:
>
> > 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.
>
> --
> Yucca, http://www.cs.tut.fi/~jkorpela/
> Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html


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

please advise. thanks!!


Jukka K. Korpela 02-22-2005 08:08 AM

Re: % characters in html code
 
jrefactors@hotmail.com wrote:

> 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.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html



Jan Faerber 02-22-2005 09:29 PM

Re: % characters in html code
 
Jukka K. Korpela ... output:

> Jan Faerber <jan.faerber@prioritytelecom.biz> wrote:
>
>> 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.


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


>> 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.


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.


--
Jan

http://html.janfaerber.com

Jukka K. Korpela 02-22-2005 10:36 PM

Re: % characters in html code
 
Jan Faerber <jan.faerber@prioritytelecom.biz> wrote:

>>> 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.

>
> 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.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html



Jan Faerber 02-22-2005 11:13 PM

Re: % characters in html code
 
Jukka K. Korpela ... output:

> Jan Faerber <jan.faerber@prioritytelecom.biz> wrote:
>
>>>> 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.

>>
>> 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).


Yes: the "+" sign. Isn't it "%20" in %HH form for the empty space? But good
that you might mention more than one possibility!

>> 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.


..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.



--
Jan

http://html.janfaerber.com


All times are GMT. The time now is 03:37 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.