[sclug] URL encoding/decoding question

pieter claassen pieter at claassen.co.uk
Mon Feb 20 22:26:48 UTC 2006


To tell you the truth, I was expecting 42. Crusty is a better programmer
than me!

So, I think this is what is happening

old		new		oldchar	newchar

26		c3		&  	?	diff 157(0x9D)
65		a2		e 	?	diff 61(0x3D)
75		c2		u  	?	diff 77 (0x4D)
72		82		r  	?	diff 16(0x10)
6f		c2 		o  	?	diff 83(0x53)
3b		ac		;  	?	diff 113(0x71)

How is it possible that 0x75 and 0x6F both encode to C2?

I don't see a pattern in the encoding lengths?

If I submit the data again through the browser, I get

c3
83
c2
a2
c3
82
c2
82
c3
82
c2
ac

P


On Mon, 2006-02-20 at 19:34 +0000, Dickon Hood wrote:
> On Mon, Feb 20, 2006 at 20:15:37 +0100, pieter claassen wrote:
> : hi Will,
> 
> : Ok, ran your code and the letter A is encoded as (wait for it)
> 
> : 41
> 
> : The string € is decoded as
> 
> : 26
> : 65
> : 75
> : 72
> : 6f
> : 3b
> 
> : I am flipped because A in UTF-8 should decode to 65 (not to say why the
> : € doesn't make any sense)
> 
> 0x41 == 65.  It's hex, as expected.
> 



More information about the Sclug mailing list