Re: JSP Internationalization



On Mar 20, 6:17 am, "mart" <mart.tho...@xxxxxxxxx> wrote:
I had a similar problem with Greek characters. The only thing that
fixed it for me was to make sure that my Oracle database was in the
correct character set, Oracle 9i did not use the standard UTF-8 unless
you set up the whole database at creation time with one obscure
character set.

Also had to put this in all my pages.
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>

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

Absolutely all of them including in all the included JSP files. That
fixed it for me. In my experience it is normally the database that is
causing the problem.

Sorry if you know this already, best of luck
cheers
Martin

On Mar 8, 4:10 pm, dschect...@xxxxxxxxx wrote:

On Mar 7, 6:01 pm, "ck" <chandankuma...@xxxxxxxxx> wrote:

On Mar 8, 2:44 am, dschect...@xxxxxxxxx wrote:

I am trying to setup a test for internationalizingJSPpages in
Japanese. I have some sample strings that I converted in resource
files which I ran through native to ascii.

When I run the pages, I do not see any Japanese characters. On the
screen I only see question marks. I tried hardcoding the unicode
encoded strings. I still get question marks. What am I missing.

The application is running on iplanet app server 6.5 and iplanet web
server 6.0.
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_04-b02)
Java HotSpot(TM) Client VM (build 1.3.1_04-b02, mixed mode)

Thanks for your input.

David

Here is the output
This is a test for Japanese: ??? ? ???

Here is theJSPsource.
<%@ page import="java.util.ResourceBundle" %>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
</head>
<body>
This is a test for Japanese:
<%
ResourceBundle res = ResourceBundle.getBundle("MyResource");
%>
<%=res.getString("teststring"); %>
<%
tmp="\u6708"; //unicode encoded
%>
<%=tmp%>
<%
tmp="十二月";
%>
<%=tmp%>
</body>
</html>

save the resource file as utf8 format. If you save it as ascii char
set you would get question marks.

--
Ckhttp://www.gfour.net-Hidequoted text -

- Show quoted text -

The native resource file is saved as UTF 8. When I run native2ascii I
specify utf-8 encodiing. The ASCII equivaluents whether from the
compiled resource file or pasted into the JSP appear as question
marks.

David

Thanks for all your responses. We do have the meta tags and the JSP
page encoding on our pages. Strings are displaying correctly from the
resource files. The issue is due, in part, to the version of our
JDK. The application server we use, iplanet 6.5, uses Java 1.3.1_04.
The URLEncoder and URLDecoder classes in this version of Java do not
support multiple encodings. When the Unicode characters are passed
through these classes, the encoding is messed up. Unfortunately, we
are not able to upgrade the application server or the JDK at this
time. Can anyone point me to a URL encoder and decoder for this
version of Java that supports Unicode. URL encoding for ASCII should
work as it does now. Encoding Unicode characters should translate
them to %u format as in %u7523.

.



Relevant Pages

  • Serius truble with encoding
    ... The web page encoding is not what's trubleing me, it's the encoding for special characters that are stored into the database. ... I have tried every character set and database connection character set and UTF-8, but it just will not stop replacing some characters, common in my native language, with question marks. ...
    (alt.php)
  • Re: Multiple SIDs (instances) possible with Oracle 8 (Unix)?
    ... We are running Oracle 8 on a W2K-server having the encoding WE8ISO8859P1. ... you would give the command "ALTER DATABASE CHARACTER SET" and the database has a new character set. ...
    (comp.databases.oracle.server)
  • Re: Creating ANSI text files with international characters
    ... encoding/codepage my outlook uses when exporting to .vcf files, ... iso-8859-1 encoding with codepage 1252. ... I'm at a complete loss as far as vCalendar files go. ... The default character set is ASCII. ...
    (microsoft.public.dotnet.framework)
  • Re: VW --> Bianary file into CLOB or BLOB
    ... Page 1252 encoding, which is normal Windows encoding for Western European ... the database as I manage this on both PostgreSQL, Oracle and ODBC ... My outstanding problem was to create a valid ByteArray from no matter ...
    (comp.lang.smalltalk)
  • Re: VW --> Bianary file into CLOB or BLOB
    ... Page 1252 encoding, which is normal Windows encoding for Western European alphabets. ... the database as I manage this on both PostgreSQL, Oracle and ODBC following the documentation. ... My outstanding problem was to create a valid ByteArray from no matter what file as I previously used the ByteArray coming from ImageReader. ...
    (comp.lang.smalltalk)