Hello,

Web browsers send user's language preferences using
"Accept-Language" HTTP header. There's an additional header "Accept-Charset".

You can use request.getHeader("Accept-Language") and 
request.getHeader("Accept-Charset") to detect these.

In servlet, use response.setContentType( "text/html; Charset=UTF-8" );

For examples and more information, you may want to refer to 
http://www.servlets.com/jsp/examples/index.html
and chapter 12 of "Java Servlet Pages" from O'Reilly.




----- Original Message -----
From: "Bhagwandas Jakhotia" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 06, 2001 12:23 AM
Subject: Auto Detection of Encodings


> Hi,
>         In the Netscape browser, we have an option , where we can
> "Autodetect", the charater set encodings.The browser autodetects the
> encodings and displays them.The encodings could be SJIS or UTF etc.,
> How does netscape recognise the encodings??
> Is it based on the headers only or the whole buffer is analysed??
>
> How can we use servlets to do the same??
>
> rgds,
> bhagwandas jakhotia
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to