Character encoding in JSP/servlet

October 26, 2005 on 4:58 pm | In Java |

To resolve character encoding problems, such as incorrect display of special characters, in Java Server Pages and servlets, follow the steps outlined below.

# Find out what character encoding is used by a) your request and b) your response with
<%= request.getCharacterEncoding() %>
<%= response.getCharacterEncoding() %>
.
# If two different encodings are used, you can force both to use the same encoding with the setCharacterEncoding() method.

To make your task easier, you would ideally be setting both to use UTF-8.

Technorati Tags: , ,

Related Posts:

No Comments yet »

RSS feed for comments on this post.

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>





Powered by blog.mu with Pool theme design by Borja Fernandez.