aspose file tools*
The moose likes Websphere and the fly likes Polish characters are gets changed to ? in websphere6.1 environment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "Polish characters are gets changed to ? in websphere6.1 environment" Watch "Polish characters are gets changed to ? in websphere6.1 environment" New topic
Author

Polish characters are gets changed to ? in websphere6.1 environment

kiran_kumar
Greenhorn

Joined: Apr 21, 2008
Posts: 18
In my application, for the name field I entered polish characters eg: ŁĄSŻKIĘWIĆZIUŚ and language is polish. I navigated to one tab to the other. The polish characters are getting changed to ?. Please help me to resolve the problem
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

What character encoding have you given your pages?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
kiran_kumar
Greenhorn

Joined: Apr 21, 2008
Posts: 18
encoding= UTF-8
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Are you perstisting these values somewhere?What character encoding does that mechanism use?
kiran_kumar
Greenhorn

Joined: Apr 21, 2008
Posts: 18
I am storing it into Oracle database.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

And is Oracle configured to support Unicode (by default it is not).
kiran_kumar
Greenhorn

Joined: Apr 21, 2008
Posts: 18
Yes, Oracle is configured to Unicode. The problem is in the Websphere61 environment only, in weblogic it is working fine.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

The only other two significant differernce would be the JVM and the data source helper class. WebSphere will be using an IBM JVM and (usually) wraps all datasource access through a helper class. However, I'm currently looking at at WebSphere/Oracle combination that is showing (what I understand to be) valid Polish characters so I'm assuming these two things are fine. If your application stack uses Unicode through out, and your HTML pages correctly set the charset in a meta tag then this should just work. The only other thing that might cause an issue is if the client you use can't support Polish - but presumably you are accessing your weblogic and webshpere apps from the same client?

Not sure what else to suggest. It sounds like somewhere in your application's string handling you are doing something unsafe, and the difference between the environments is exposing it. Do you use getBytes anywhere? Or the new String(byte[] bytes) constructor?

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18154
    
    8

This article covers all the points you need to know: Character Conversions from Browser to Database
Steve Wink
Ranch Hand

Joined: May 13, 2002
Posts: 223
One other thing is that WebSphere will want a JVM setting:

-Dclient.encoding.override=UTF-8

in the process definition->Java Virtual Machine tab of the admin console.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Steve Wink wrote:One other thing is that WebSphere will want a JVM setting:

-Dclient.encoding.override=UTF-8

in the process definition->Java Virtual Machine tab of the admin console.


Will this override the encoding defined by the content-type of the response? Its a bit devious if it does.
Steve Wink
Ranch Hand

Joined: May 13, 2002
Posts: 223
Looking at this
http://www-01.ibm.com/software/globalization/j2ee/encoding.jsp

it looks like it does. And in fact it will override for all apps on that server, which is very devious, so maybe its not the best thing to use.

Back to the original question, as has been mentioned there maybe something in the application breaking it. I found searching for ByteArrayOutputStreams and similar classes found a lot of the problems.
kiran_kumar
Greenhorn

Joined: Apr 21, 2008
Posts: 18
I tried by setting jvm arguments.. but it is not working.

I am using jsf page.. Polish characters are displaying correctly in a label i.e. <trutputLabel used for that.
But the same polish characters are converting into ? in a text box i.e. ><tr:inputText

This is happening when i move from one tab to other tab. If i do refresh on the page polish characters are coming correctly.

><trh:cellFormat id="p_1096_pm_desc_gen19" >
<trutputLabel id="p_1097_pm_desc_gen20" styleClass="textlable" value="#{pmmsgs.values.firstname}" />
</trh:cellFormat>
<trh:cellFormat id="p_1098_pm_desc_gen21" halign="right">
<tr:inputText id="p_1099_pm_desc_gen22" maximumLength="255" shortDesc="#{(contexthelp.shortDesc == false)? nodata : pmmsgs.values.enterfirstname}" validator="#{usersGeneralBackingBean.validateFirstName}" required="true" value="#{usersGeneralBackingBean.pageDataBean.userObject.firstName}" requiredMessageDetail="#{pmmsgs.values.new_user_firstname_prompt}" label=" " disabled="#{usersDescriptionBackingBean.pageDataBean.renderModify == false || usersGeneralBackingBean.pageDataBean.canUpdateEntity == false}"/>
</trh:cellFormat>

Steve Wink
Ranch Hand

Joined: May 13, 2002
Posts: 223
kiran_kumar wrote:I tried by setting jvm arguments.. but it is not working.

I am using jsf page.. Polish characters are displaying correctly in a label i.e. <trutputLabel used for that.
But the same polish characters are converting into ? in a text box i.e. ><tr:inputText

This is happening when i move from one tab to other tab. If i do refresh on the page polish characters are coming correctly.

><trh:cellFormat id="p_1096_pm_desc_gen19" >
<trutputLabel id="p_1097_pm_desc_gen20" styleClass="textlable" value="#{pmmsgs.values.firstname}" />
</trh:cellFormat>
<trh:cellFormat id="p_1098_pm_desc_gen21" halign="right">
<tr:inputText id="p_1099_pm_desc_gen22" maximumLength="255" shortDesc="#{(contexthelp.shortDesc == false)? nodata : pmmsgs.values.enterfirstname}" validator="#{usersGeneralBackingBean.validateFirstName}" required="true" value="#{usersGeneralBackingBean.pageDataBean.userObject.firstName}" requiredMessageDetail="#{pmmsgs.values.new_user_firstname_prompt}" label=" " disabled="#{usersDescriptionBackingBean.pageDataBean.renderModify == false || usersGeneralBackingBean.pageDataBean.canUpdateEntity == false}"/>
</trh:cellFormat>



I'm afraid I don't know about JSF.

Is there any JavaScript involved? Some JavaScript method specifically target the latin characterset- there are alternative methods that support multibyte characters.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Polish characters are gets changed to ? in websphere6.1 environment
 
Similar Threads
Data is not rendering properly when swtich from one tab to other
get numeric character representation for Polish unicode characters
hibernate update
Problem with <tr:inputDate
WA #1.....word association