[omniORB] corbaloc & codeset
Duncan Grisby
duncan at grisby.org
Mon Jul 31 09:21:36 BST 2006
On Friday 28 July, JiangWei wrote:
> 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
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 --
-- duncan at grisby.org --
-- http://www.grisby.org --
More information about the omniORB-list
mailing list