[omniORB] [patch] accept python str for CORBA wstring str

Luke Deller ldeller at xplantechnology.com
Fri Sep 24 13:10:54 BST 2004


Please find attached a small patch which allows omniORBpy to accept a python str for a CORBA wstring.  It also allows a python str to be accepted for a CORBA wchar, so long as the string decodes to a single unicode character.

I've put this patch together with my __repr__ implementation patch on the web at:

    http://www.xplantechnology.com/~luked/omni/

Feedback is welcome.

Regards,
Luke.

Luke Deller wrote:
> Hi,
> 
> Do you think it is a good idea for omniORB to be a bit more relaxed 
> about str/unicode mismatches?
> 
> Python itself will happily converts implicitly from str to unicode [eg 
> 'hi' + u'there'] and from unicode to str [eg sys.stdout.write(u'test'), 
> using the default encoding].  OmniORBpy however will throw a BAD_PARAM 
> exception when trying to marshal a python str to a CORBA wstring, or a 
> python unicode string to a CORBA string.
> 
> I can suggest a patch to make omniORB relax in this regard... but before 
> I do so, can somebody tell me if it's a bad idea?
> 
> Thanks,
> Luke.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: omniORBpy-wstring.patch
Type: text/x-patch
Size: 4696 bytes
Desc: not available
Url : http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20040924/69f42beb/omniORBpy-wstring.bin


More information about the omniORB-list mailing list