Discussion:
[omniORB] corbaloc & codeset
JiangWei
2006-07-28 12:43:49 UTC
Permalink
server nativeCharCodeSet: UTF-8
client nativeCharCodeSet: UTF-8

str = ... # UTF-8 string

o = orb.string_to_object('corbaloc::..............')
object = o._narrow(...)
object.echo_string(str) #throw omniORB.CORBA.DATA_CONVERSION:
CORBA.DATA_CONVERSION(omniORB.DATA_CONVERSION_BadInput,CORBA.COMPLETED_NO)

object2 = orb.string_to_object('IOR:......................')
object2.echo_string(str) #OK
Duncan Grisby
2006-07-31 13:21:33 UTC
Permalink
Post by JiangWei
server nativeCharCodeSet: UTF-8
client nativeCharCodeSet: UTF-8
str = ... # UTF-8 string
o = orb.string_to_object('corbaloc::..............')
object = o._narrow(...)
CORBA.DATA_CONVERSION(omniORB.DATA_CONVERSION_BadInput,CORBA.COMPLETED_NO)
object2 = orb.string_to_object('IOR:......................')
object2.echo_string(str) #OK
This is due to the way codesets are handled in CORBA. It is not a bug in
omniORB. Servers publish the codesets they understand in IORs. Based on
that, clients decide which codesets they can use to communicate with the
server. A corbaloc URI is equivalent to an IOR with no codeset
information in it, so the CORBA spec requires omniORB to treat it as
though the only codeset it supports is ISO 8859-1. omniORB therefore
tries to convert your UTF-8 string to ISO 8859-1, and fails with a
DATA_CONVERSION exception when it encounters a character it cannot
convert.

I'm afraid you can't use codesets other than ISO 8859-1 with corbaloc
URIs. It's not an omniORB issue but a CORBA specification issue.

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
JiangWei
2006-07-31 14:26:27 UTC
Permalink
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20060731/6e02f907/attachment.htm
Duncan Grisby
2006-08-03 22:04:02 UTC
Permalink
Post by Duncan Grisby
This is due to the way codesets are handled in CORBA. It is not a bug in
omniORB. Servers publish the codesets they understand in IORs. Based on
that, clients decide which codesets they can use to communicate with the
server. A corbaloc URI is equivalent to an IOR with no codeset
information in it, so the CORBA spec requires omniORB to treat it as
though the only codeset it supports is ISO 8859-1.
even after '_narrow()'?
Yes, even after _narrow. Narrow merely confirms that an object reference
supports the interface you want. It does not retrieve a new object
reference from the server, which is what has to happen for it to get
codeset information from the server.

You can choose to implement your servant in the omniINS POA so it throws
omniORB::LocationForward exceptions from all calls, forwarding the
caller to another object reference. That way, the codeset information
will be sent to the client and it will retry the invocation.

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Loading...