Application Server Solutions for Microsoft IIS and ASP.NET
       solutions   products   partners   company   support   downloads         store
ServletExec Self-Help: FAQ
Back to Search >  Back to Search Results

Faq ID 116
Product ServletExec
Category Internationalization, JSP
Question How can I use ServletExec to send a response to the client using a character set other than English (i.e. International Content / Localized Content) ?
Answer For servlets
  1. Call response.setContentType( "text/html; charset=utf-8" );
  2. Call PrintWriter writer = response.getWriter();
  3. Pass the writer Unicode characters.

For JSPs
  1. In the JSP page, use a page directive to set the content type like this (example shown is for Chinese):
    <%@ page contentType = "text/html;charset=big5" %>

    NOTE: This indicates the charset for both the JSP page itself as well as the content that is sent back to the browser. This means that you will have to author your JSP page using a text editor that will allow you to save the JSP with the specified charset.

Readers of this FAQ may also benefit from reading SE FAQ #128

company media information terms of use privacy policy contact us