Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

is that a websphere/DB2 bug

  Asked By: Abbie    Date: Jul 09    Category: Java    Views: 705
  

i wanna ask a question about websphere version 4/DB2
i had this code [i've attached below]
to make websphere supports arabic
and it did accepted arabic
but the problem was when
we've tried to pass paramters from websphere to
be inserted into the DB2
it stored as squareshow can i fix this
here's the code

********************************************************

Is there any setting that should be configured in the WebSphere
Application
Server itself for Arabic or Hebrew?


Yes, since ISO 8859-6 codepage is assumed to be the default codepage
for
Arabic, and ISO 8859-8 for Hebrew, which is not always the case.

To handle this, the needed encoding conversion must be applied before
processing the request in the Servlet. This encoding (Cp1256 for Arabic
and
Cp1255 for Hebrew, or UTF-8 for both) is applied as follows:

7 Under the AppServer installation folder open the following
file:

Drive/AppServer/Properties/encoding.properties

7 Change the value of the Arabic encoding from "ar=ISO-8859-6"
to
"ar=Cp1256" for Arabic or the required codepage, then restart the
application server service.



Setting the encoding in the HTML page

For the HTML, we can set the encoding using the following Meta tag:

For Arabic:
< head>
< META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8 or
windows-1256 or iso-8859-6">
< /head>




Setting the encoding in Servlet:
For the Servlet, there are two ways; the simplest of which is to
specify the
encoding in the setContentType method as follows:

For Arabic:
response.setContentType("text/html ;charset=windows-1256 or
iso-8859-6");
or
response.setContentType("text/html ;charset=UTF-8");
PrintWriter out=res.getWriter();

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on is that a websphere/DB2 bug Or get search suggestion and latest updates.




Tagged: