You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Paul Darling <pa...@tumbleweed.com> on 2001/01/12 23:48:10 UTC

How to support multiple encodings from the browser

Hi,

I'm interested to know how other applications handle string values input via
browsers that do not send the encoding information.  Without knowing the
encoding of the input text, there seems no way that the correct Unicode
string can be derived that reflects the text that the user intended.  

Our application uses servlet 2.2, and so is able to call
ServletRequest.setCharacterEncoding().  But I don't see how this would help
us anyhow, unless there is a way of determining the encoding of the input
stream.

The charset value in the content-type header of the *.jsp does appear to
control the encoding of text input via IE.  But Netscape appears to send the
text in whatever encoding is specified as the "Character Set" value,
regardless of the content-type header of the page. 

The user could be required to specify the langauge they are using, but I was
hoping for something more dyanamic and reliable than this.    

This is probably not a struts specific issue, but any insights would be
appreciated,

Paul Darling