[SLUG] Re: Scarborough Digest, Vol 145, Issue 1

Martin Webb martin at webb.lcbroadband.co.uk
Fri Aug 4 22:38:50 BST 2006


Stephen O'Neill wrote:
>> Martin Webb wrote:
>>>> It's an HTML/XML escape code
> 
>> Thanks, David.  If possible, I'd like to know more.  It's something that 
>> I've often seen when sending e-mails to certain people who use Hotmail. 
>>  The e-mail they receive is peppered with stuff like that.  What 
>> exactly is happening?
> 
> Certain characters in HTML have special meaning and others aren't standard ASCII characters so need encoding.
> 
> For example the literal character "&" (ampersand) is a special character in HTML. If you want to include this character in HTML and is used to denote that a special character entity is about to use. This means that to put an ampersand into a valid HTML document you must in fact replace it with its HTML entity.
> 
> So, & (ampersand) is written in the HTML source as &. "&amp" is the HTML entity for ampersand. But when you view the webpage you obviously see &.
> 
> The British pound sign isn't a standard ASCII character so should also be replaced with a HTML entity. This entity is £. When you view a webpage with £ in the source you will see a British pound sign.
> 
> Now, to answer you question. Basically there is a system along the chain which is getting confused. 
> 
> What happens is that at the beginning the source code said " £25 ". This meant that it was intended that this display as " £25 ".
> 
> However, a system somewhere got confused. When it saw the " £25 " it said "ah, but you're sending this message as HTML, but have included the special & character. That means I need to replace it with the HTML entity".
> 
> So, it replaces it and leave " &pound25 " in the source code. Notice that the & has become &.
> 
> Now, when this renders it replaces & with & and then renders pound25. So you get " &pound25 ".
> 
> I suspect that the somewhere along the line when you "forward" a HTML email which has encoded entities in it you end up with these double-encodings. So when John hit "forward" something went Pete Tong and got confused.
> 
> Anyway, sorry for the long-winded reply - I hope that it makes some sense!
> 
> Steve O

That's good.  Thanks!
Martin




More information about the Scarborough mailing list