Two Laptop Bag
The moose likes JSP and the fly likes Issue with rendering French & German characters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Issue with rendering French & German characters " Watch "Issue with rendering French & German characters " New topic

Issue with rendering French & German characters

Elan Ram
Ranch Hand

Joined: Dec 14, 2006
Posts: 40

Currently I am facing some issue with rendering French & German characters through JSP.
In firefox, all are fine and rendering properly, but the problem is with the IE 6.0. Its not displaying properly. For example:

�� � � � � � � �� this search term rendered as ��„ �� �– �� �œ �� �Ÿ �‚��

Also there is a solution in the Web says It will be resolved, if we put the URI encoding to UTF-8 in server.xml of Tomcat. But if I use the above solution, French characters are working in IE and not working in the firefox.

For more information, we are using:

1) Tomcat 5.5.x

2) In JSP, we are using following meta tag and encoding:

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

Note: I have tried with iso-8859-15 instead of UTF-8. But no use.

Any help or pointers highly appriciated.
Thanks in advance.

Thanks and regards,
Rajeev Desh

Joined: Sep 05, 2008
Posts: 4
Try reading the value in byte stream and then convert them into UTF-8 format then ISO-8869-1 format to display in jsp.

if your variable carrying foreign language characters eg:fChar ="� � � �"
then write a method that returns it as string after convertion:
public String returnChar(String fChar){
StringBuffer buffer = new StringBuffer();
try {
ByteArrayInputStream bais = new ByteArrayInputStream(fChar.getBytes("ISO-8859-1"));
InputStreamReader isr = new InputStreamReader(bais,"UTF-8");
Reader in = new BufferedReader(isr);
int ch;
while ((ch = > -1) {
return buffer.toString();

hope this may help you / you can make a little modification to get the desired result

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
Note that ISO-8859-15 is not the standard ISO-8859 code; that would be "ISO-8859-1".

You could check whether IE correctly picks up on the UTF-8 encoding. You could also check if the correct Unicode character codes are sent for those characters.
Elan Ram
Ranch Hand

Joined: Dec 14, 2006
Posts: 40
Hi Rajeev & Ulf,

IE is not sending the request header �accept-charset� itself to server side. But FF does it.
Also I have tried Rajeev solution, seems to be working to my situation. So I can go with it.

Thanks for your replies.

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63865

"Elan R", please check your private messages for an important administrative matter.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Issue with rendering French & German characters
It's not a secret anymore!