[opencms-dev] Request character encoding - An answer with a n ew Q

Martin Kuba makub at ics.muni.cz
Fri May 28 09:51:00 CEST 2004


Vlachogiannis Evangelos wrote:
> My operating system (winxp) uses "Cp1252" that's why it is working like
> this. But my question is how can I know what encoding the client uses. I
> cannot see being able to retrieve this from request headers. Any ideas
> please?
> 
> Please correct me if I am wrong request encoding is depends on tomcat
> encoding (??).

There is no way to know for sure the encoding the client uses.
It is a flaw in HTTP protocol which doesn't provide a way
for GET requests to specify encoding, so POST requests do not do it
also.

However the common practice used by all browsers is to submit
data from forms in the same encoding as was the page with the form.
So if all your pages are in, say, ISO-8859-7, then you can
safely expect the requests to be in the same encoding.

Martin
-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Supercomputing Center Brno             Martin Kuba
Institute of Computer Science    email: makub at ics.muni.cz
Masaryk University             http://www.ics.muni.cz/~makub/
Botanicka 68a, 60200 Brno, CZ     mobil: +420-603-533775
--------------------------------------------------------------



More information about the opencms-dev mailing list