You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Raghuveer <ra...@infotechsw.com> on 2008/05/23 12:51:08 UTC
i18n Struts Jco Code in Windows English and Polish System
I am working on Struts ,SAP-JCO .
This is i18n application running on Tomcat.
I have designed my application in UTF8 charset.
When Saving the polish characters from application they are saved into SAP
Database properly.
Before Saving i am doing following String modifications.
The same code doesn't work on Tomcat Server on Windows English System.Here
the Polish characters( aeclónszz ) are saved as #########.
What would be cause for this.
What changes i need to do in my code to work on both English And Polish
Windows (Tomcat Server)
--------------------
strConvertedMessage = new String(strText.getBytes("UTF8"), "UTF8");
inputTable.setValue(strConvertedMessage,"TABLENAME");
Re: i18n Struts Jco Code in Windows English and Polish System
Posted by Laurie Harper <la...@holoweb.net>.
Raghuveer wrote:
> I am working on Struts ,SAP-JCO .
>
> This is i18n application running on Tomcat.
>
> I have designed my application in UTF8 charset.
>
> When Saving the polish characters from application they are saved into SAP
> Database properly.
>
> Before Saving i am doing following String modifications.
>
> The same code doesn't work on Tomcat Server on Windows English System.Here
> the Polish characters( aeclónszz ) are saved as #########.
>
> What would be cause for this.
>
> What changes i need to do in my code to work on both English And Polish
> Windows (Tomcat Server)
>
> --------------------
>
> strConvertedMessage = new String(strText.getBytes("UTF8"), "UTF8");
> inputTable.setValue(strConvertedMessage,"TABLENAME");
That string conversion is redundant. You are saying "convert this string
into a sequence of bytes in UTF-8 and then interpret those bytes as
UTF-8 to construct a new string." Assuming strText is not null,
strText.equals(strConvertedMessage) is garanteed true.
There are a number of places where character set conversion can get
messed up. It may be right up front when accessing the request
parameters, during propagation into your SAP database, on retrieval from
the database, or during output (assuming you're not doing something bad
with the data in between those points).
Start by figuring out exactly where the mis-encoding occurs; that should
tell you which input/output boundary to concentrate on.
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: i18n Struts Jco Code in Windows English and Polish System
Posted by Roger Varley <ro...@googlemail.com>.
On Friday 23 May 2008 13:51:08 Raghuveer wrote:
> I am working on Struts ,SAP-JCO .
>
> This is i18n application running on Tomcat.
> I have designed my application in UTF8 charset.
>
> When Saving the polish characters from application they are saved into SAP
> Database properly.
> Before Saving i am doing following String modifications.
> The same code doesn't work on Tomcat Server on Windows English System.Here
> the Polish characters( aeclónszz ) are saved as #########.
> What would be cause for this.
>
> What changes i need to do in my code to work on both English And Polish
> Windows (Tomcat Server)
>
> strConvertedMessage = new String(strText.getBytes("UTF8"), "UTF8");
>
> inputTable.setValue(strConvertedMessage,"TABLENAME");
Without more information, it's difficult to suggest the soloution, but a
couple of questions come to mind. Firstly what are the values of
strConvertedMessage and inputTable before you try to update SAP? Have you
tried debugging your Function Module in SAP to see what SAP is recieving
before you commit your update to the database (I assume that its Oracle?)
Regards
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org