[Web-SIG] parsing of urlencoded data and Unicode

Manlio Perillo manlio_perillo at libero.it
Tue Jul 29 19:55:11 CEST 2008


Bill Janssen ha scritto:
>> Ok with theory.
>> But in practice:
> 
> Seems like you're looking at a broken browser there.
> 

Right.
It's Firefox.
But it's the same with IE 6 and Opera.

> Can anyone point to where a W3C standard or IETF RFC describes this
> behavior?
> 
>> I think that it is safe to decode data from the QUERY_STRING and POST=20
>> data to Unicode, and to return Bad Request in case of errors.
> 
> It's clearly not safe to do so generally.  If you do decide to do
> this, please tell me what framework you're building so that I can
> avoid it :-).
> 

No, wait.
I don't blindly guess the encoding.

I first try the content-type header, then the special _charset_ field, 
and finally utf-8.


If there is a problem in the decoding, the client is broken (or there is 
a bug in the application).
So the correct response is Bad Request, IMHO.

> Bill
> 


Manlio Perillo


More information about the Web-SIG mailing list