You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@etch.apache.org by "Tohru Ohzono -X (tohzono)" <to...@cisco.com> on 2009/01/13 08:42:57 UTC
Etch Csharp binding CultureInfo issue?
Hi all,
I think there is a problem with etch C# binding in Japanease
Environment( or some other country).
In the "ReadSocket()" method of the "Etch.Util.TcpTransport.cs",
The following cause a problem in Japanease Environment.
//---------------------------------//
if (e.Message == null)
throw e;
if (e.Message.Contains("connection was aborted"))
return;
if (e.Message.Contains("blocking operation"))
return;
if (e.Message.Contains("socket closed"))
return;
if (e.Message.Contains("read operation failed"))
return;
throw e;
//---------------------------------//
The "e.Message" returns Localized Message if a .Net Framework Language
Pack is installed.
(Japanease Language pack is installed, e.Message returns a message in
Japanease)
So, any exceptions are thrown to the outside.
I know one workaround.
It will work well,
if the line "thisThread.CurrentCulture = CultureInfo.InvariantCulture;"
is added
at the top of "Run()" mehod of the "Etch.Util.Runner.cs".
(Instead, we become unable to get localized exception message from this
thread.
But, it will be acceptable for Japanease developers.)
Any other good ideas?
Regards,
Tohru
Re: Etch Csharp binding CultureInfo issue?
Posted by "scott comer (sccomer)" <sc...@cisco.com>.
you're right, we don't get localized anything in the java runtime.
thanks very much!
scott out
Tohru Ohzono -X (tohzono) wrote:
> Hi, Scott
>
> Thank you very much for your response.
>
> In the java, there seems to be no problem
> because java has two separated property for the exception message,
> Exception.getMessage() and Exception.getLocalizedMessage().
> And I think the Exception.getMessage() is used in the etch java runtime.
> I'm not sure exactly because I've not tested detail.
> But, I've never encountered the same problem by using java runtime in my
> daily use.
> I'll investigate more detail for java.
>
> OK, I'll create a jira issue for this.
>
> Thanks,
> Tohru
>
>
>> -----Original Message-----
>> From: Scott Comer (sccomer)
>> Sent: Wednesday, January 14, 2009 10:53 PM
>> To: etch-dev@incubator.apache.org
>> Subject: Re: Etch Csharp binding CultureInfo issue?
>>
>> tohru,
>>
>> this would probably be a problem in the java runtime as well.
>> it never occurred to me that the messages would be localized.
>> there is probably a way to get the non-localized version of
>> the message (another property) without the drastic step you
>> describe. i'll look into it. if you have time and interest,
>> would you please create a jira issue for this:
>>
>> https://issues.apache.org/jira/browse/ETCH
>>
>> if not, let me know and i will.
>>
>> thanks,
>> scott
>>
>> Tohru Ohzono -X (tohzono) wrote:
>>
>>> Hi all,
>>>
>>> I think there is a problem with etch C# binding in Japanease
>>> Environment( or some other country).
>>>
>>> In the "ReadSocket()" method of the
>>>
>> "Etch.Util.TcpTransport.cs", The
>>
>>> following cause a problem in Japanease Environment.
>>>
>>> //---------------------------------//
>>> if (e.Message == null)
>>> throw e;
>>> if (e.Message.Contains("connection was aborted"))
>>> return;
>>> if (e.Message.Contains("blocking operation"))
>>> return;
>>> if (e.Message.Contains("socket closed"))
>>> return;
>>> if (e.Message.Contains("read operation failed"))
>>> return;
>>>
>>> throw e;
>>> //---------------------------------//
>>>
>>>
>>> The "e.Message" returns Localized Message if a .Net
>>>
>> Framework Language
>>
>>> Pack is installed.
>>> (Japanease Language pack is installed, e.Message returns a
>>>
>> message in
>>
>>> Japanease)
>>> So, any exceptions are thrown to the outside.
>>>
>>>
>>> I know one workaround.
>>> It will work well,
>>> if the line "thisThread.CurrentCulture =
>>>
>> CultureInfo.InvariantCulture;"
>>
>>> is added
>>> at the top of "Run()" mehod of the "Etch.Util.Runner.cs".
>>> (Instead, we become unable to get localized exception message from
>>> this thread.
>>> But, it will be acceptable for Japanease developers.)
>>>
>>>
>>> Any other good ideas?
>>>
>>>
>>> Regards,
>>> Tohru
>>>
>>>
RE: Etch Csharp binding CultureInfo issue?
Posted by "Tohru Ohzono -X (tohzono)" <to...@cisco.com>.
Hi, Scott
Thank you very much for your response.
In the java, there seems to be no problem
because java has two separated property for the exception message,
Exception.getMessage() and Exception.getLocalizedMessage().
And I think the Exception.getMessage() is used in the etch java runtime.
I'm not sure exactly because I've not tested detail.
But, I've never encountered the same problem by using java runtime in my
daily use.
I'll investigate more detail for java.
OK, I'll create a jira issue for this.
Thanks,
Tohru
> -----Original Message-----
> From: Scott Comer (sccomer)
> Sent: Wednesday, January 14, 2009 10:53 PM
> To: etch-dev@incubator.apache.org
> Subject: Re: Etch Csharp binding CultureInfo issue?
>
> tohru,
>
> this would probably be a problem in the java runtime as well.
> it never occurred to me that the messages would be localized.
> there is probably a way to get the non-localized version of
> the message (another property) without the drastic step you
> describe. i'll look into it. if you have time and interest,
> would you please create a jira issue for this:
>
> https://issues.apache.org/jira/browse/ETCH
>
> if not, let me know and i will.
>
> thanks,
> scott
>
> Tohru Ohzono -X (tohzono) wrote:
> > Hi all,
> >
> > I think there is a problem with etch C# binding in Japanease
> > Environment( or some other country).
> >
> > In the "ReadSocket()" method of the
> "Etch.Util.TcpTransport.cs", The
> > following cause a problem in Japanease Environment.
> >
> > //---------------------------------//
> > if (e.Message == null)
> > throw e;
> > if (e.Message.Contains("connection was aborted"))
> > return;
> > if (e.Message.Contains("blocking operation"))
> > return;
> > if (e.Message.Contains("socket closed"))
> > return;
> > if (e.Message.Contains("read operation failed"))
> > return;
> >
> > throw e;
> > //---------------------------------//
> >
> >
> > The "e.Message" returns Localized Message if a .Net
> Framework Language
> > Pack is installed.
> > (Japanease Language pack is installed, e.Message returns a
> message in
> > Japanease)
> > So, any exceptions are thrown to the outside.
> >
> >
> > I know one workaround.
> > It will work well,
> > if the line "thisThread.CurrentCulture =
> CultureInfo.InvariantCulture;"
> > is added
> > at the top of "Run()" mehod of the "Etch.Util.Runner.cs".
> > (Instead, we become unable to get localized exception message from
> > this thread.
> > But, it will be acceptable for Japanease developers.)
> >
> >
> > Any other good ideas?
> >
> >
> > Regards,
> > Tohru
> >
>
Re: Etch Csharp binding CultureInfo issue?
Posted by "scott comer (sccomer)" <sc...@cisco.com>.
tohru,
this would probably be a problem in the java runtime as well. it never
occurred to
me that the messages would be localized. there is probably a way to get
the non-localized
version of the message (another property) without the drastic step you
describe. i'll look
into it. if you have time and interest, would you please create a jira
issue for this:
https://issues.apache.org/jira/browse/ETCH
if not, let me know and i will.
thanks,
scott
Tohru Ohzono -X (tohzono) wrote:
> Hi all,
>
> I think there is a problem with etch C# binding in Japanease
> Environment( or some other country).
>
> In the "ReadSocket()" method of the "Etch.Util.TcpTransport.cs",
> The following cause a problem in Japanease Environment.
>
> //---------------------------------//
> if (e.Message == null)
> throw e;
> if (e.Message.Contains("connection was aborted"))
> return;
> if (e.Message.Contains("blocking operation"))
> return;
> if (e.Message.Contains("socket closed"))
> return;
> if (e.Message.Contains("read operation failed"))
> return;
>
> throw e;
> //---------------------------------//
>
>
> The "e.Message" returns Localized Message if a .Net Framework Language
> Pack is installed.
> (Japanease Language pack is installed, e.Message returns a message in
> Japanease)
> So, any exceptions are thrown to the outside.
>
>
> I know one workaround.
> It will work well,
> if the line "thisThread.CurrentCulture = CultureInfo.InvariantCulture;"
> is added
> at the top of "Run()" mehod of the "Etch.Util.Runner.cs".
> (Instead, we become unable to get localized exception message from this
> thread.
> But, it will be acceptable for Japanease developers.)
>
>
> Any other good ideas?
>
>
> Regards,
> Tohru
>