By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,468 Members | 1,872 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,468 IT Pros & Developers. It's quick & easy.

Chinese - German character woes in JSP

P: n/a
Having a problem displaying both german and chinese characters from a
UTF-8 database on the same *.jsp page.

Can make Chinese characters appear correctly by including the following
lines:

<%@ page pageEncoding="UTF-8" %>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
However, if I include the <meta> tag it then makes special german
characters unreadable. If I remove the <meta> tag German characters
display properly but Chinese characters do not.

We are trying to display them on the same page, because ultimately
Chinese and German will be served on the same site.

TIA,
Jeff

Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Jeff wrote:
Having a problem displaying both german and chinese characters from a
UTF-8 database on the same *.jsp page.

Can make Chinese characters appear correctly by including the following
lines:

<%@ page pageEncoding="UTF-8" %>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
However, if I include the <meta> tag it then makes special german
characters unreadable. If I remove the <meta> tag German characters
display properly but Chinese characters do not.

We are trying to display them on the same page, because ultimately
Chinese and German will be served on the same site.

TIA,
Jeff


How are your German texts being generated? If they are coming from Java
strings and UTF-8 encoding is specified, then everythig should work. If
however you're fetching 8-bit German text out of a file or a database then
somewhere along the line you need to translate from ISO 8859-1 to UTF-8.
Check that your default encoding is set to UTF-8 and that all your
conversions between byte[] and String are kosher.

If you consistently use UTF-8 and the web browser is not totally broken
(big "if"!) then it should be perfectly possibly to mike German and Chinese.

--
Chris Gray ch***@kiffer.eunet.be

Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.