You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by pavel <pa...@icecentric.com> on 2003/02/12 19:06:11 UTC

emergency

Hello,

Please, could you help me to set up turbine encoding right. We have 
small app in 9 languages - have no problem to render the pages on the 
screen but the data do not go right in the database. The app is live 
now. Fortunately because of time shift most foreign countries have night 
there. So, I have a couple of hours to fix that.

 We had it working fine in T2.1 (used default settings) and now in T2.2 
we expected to be the same settings. It is my fault I did not check that.

Please, could you tell me what exactly I have to set up so that the data 
go right in the database. Speaking of languages we have a mix of 
Chinese, korean, japanese, english, german ...

I found in TurbineResources.properties :
#services.VelocityService.input.encoding=UTF-8

Is that all? Or something more is involved?

Thank you very much.

Pavel


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: emergency

Posted by pavel <pa...@icecentric.com>.
Thank you!

CP Lim wrote:

> Hi Pavel,
>
> I'm guessing you're talking about submitting data via. forms.  What 
> you first need to know is what encoding the submitted data is in.  For 
> example if you use EUC-JP, then what you'll have to do is before 
> accessing Strings from your ParameterParser object, you'll have to 
> convert them from ISO-8859-1 to EUC-JP.  eg.
>
> ----------------------------------------------------------------
> public void convert(RunData data, String name)
> {
>     ParameterParser parser = data.getParameter();
>     String unconverted = parser.getString(name);
>     String converted = null;
>     try
>     {
>         if(unconverted != null)
>         {
>             byte[] bytes = unconverted.getBytes("8859_1");
>             converted = new String(bytes, "EUC-JP");
>         }
>     }
>     catch(UnsupportedEncodingException e)
>     {
>         // handle problem converting data
>     }
>
>     return converted;
> }
> ----------------------------------------------------------------
>
> Have a look at this link: 
> http://forum.java.sun.com/thread.jsp?thread=325429&forum=16&message=1320661 
>
>
> It claims that we shouldn't need to do this for Tomcat v4.x, but it 
> seems that I still need to, so that is (part of) my work around.
>
> cheers,
> CP
>
> pavel wrote:
>
>> Hello,
>>
>> Please, could you help me to set up turbine encoding right. We have 
>> small app in 9 languages - have no problem to render the pages on the 
>> screen but the data do not go right in the database. The app is live 
>> now. Fortunately because of time shift most foreign countries have 
>> night there. So, I have a couple of hours to fix that.
>>
>> We had it working fine in T2.1 (used default settings) and now in 
>> T2.2 we expected to be the same settings. It is my fault I did not 
>> check that.
>>
>> Please, could you tell me what exactly I have to set up so that the 
>> data go right in the database. Speaking of languages we have a mix of 
>> Chinese, korean, japanese, english, german ...
>>
>> I found in TurbineResources.properties :
>> #services.VelocityService.input.encoding=UTF-8
>>
>> Is that all? Or something more is involved?
>>
>> Thank you very much.
>>
>> Pavel
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>>
>>
>>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: emergency

Posted by CP Lim <cp...@redsheriff.com>.
Hi Pavel,

I'm guessing you're talking about submitting data via. forms.  What you 
first need to know is what encoding the submitted data is in.  For 
example if you use EUC-JP, then what you'll have to do is before 
accessing Strings from your ParameterParser object, you'll have to 
convert them from ISO-8859-1 to EUC-JP.  eg.

----------------------------------------------------------------
public void convert(RunData data, String name)
{
     ParameterParser parser = data.getParameter();
     String unconverted = parser.getString(name);
     String converted = null;
     try
     {
         if(unconverted != null)
         {
             byte[] bytes = unconverted.getBytes("8859_1");
             converted = new String(bytes, "EUC-JP");
         }
     }
     catch(UnsupportedEncodingException e)
     {
         // handle problem converting data
     }

     return converted;
}
----------------------------------------------------------------

Have a look at this link: 
http://forum.java.sun.com/thread.jsp?thread=325429&forum=16&message=1320661

It claims that we shouldn't need to do this for Tomcat v4.x, but it 
seems that I still need to, so that is (part of) my work around.

cheers,
CP

pavel wrote:
> Hello,
> 
> Please, could you help me to set up turbine encoding right. We have 
> small app in 9 languages - have no problem to render the pages on the 
> screen but the data do not go right in the database. The app is live 
> now. Fortunately because of time shift most foreign countries have night 
> there. So, I have a couple of hours to fix that.
> 
> We had it working fine in T2.1 (used default settings) and now in T2.2 
> we expected to be the same settings. It is my fault I did not check that.
> 
> Please, could you tell me what exactly I have to set up so that the data 
> go right in the database. Speaking of languages we have a mix of 
> Chinese, korean, japanese, english, german ...
> 
> I found in TurbineResources.properties :
> #services.VelocityService.input.encoding=UTF-8
> 
> Is that all? Or something more is involved?
> 
> Thank you very much.
> 
> Pavel
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> 
> 
> 


-- 
R E D S H E R I F F
C.P. Lim - Software Engineer
Level 1, 10 Queens Road    +61 3 9864 0733 tel
Melbourne VIC              +61 3 9864 0778 fax
Australia                  +61 413 781 846 mob

This message and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom they are 
addressed. If you are not the intended recipient, you are hereby 
notified that any use or dissemination of this communication is strictly 
prohibited. If you have received this message in error please notify us 
immediately by return email or telephone +61 (3) 9659 0432, then delete 
this message. Any views expressed in this message are those of the 
individual sender and many not necessarily reflect the views of Red 
Sheriff.


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org