[omniORB] MacRoman codeset for Mac OS X?

Duncan Grisby duncan at grisby.org
Mon Feb 20 17:04:36 GMT 2006


On Sunday 19 February, "Steve Sauder" wrote:

> We've been using omniORB 4 for some time now to have our Mac OS-based
> client application communicate with our server-side server side
> objects, with good success.  However, I've recently been required to
> support foreign character sets, and in delving into the omniORB
> codeset implementations, I noticed that the default codeset for
> omniORB is ISO-8859-1, and that it doesn't appear that there even is a
> NCS_C variant for Mac Roman.
> 
> Is this correct?  Will I need to write my own?

You're right that there's no MacRoman codeset (unless it's the same as
one of the ISO-8859 codesets). It is quite easy to add more codesets to
the codesets library. Look in src/lib/omniORB/codesets/ . You basically
just need to enter the translation tables for the codeset.

> One avenue that I was looking into was the use of CORBA::WString
> instead CORBA::String and just sending Unicode.  While I was checking
> all this out, I discovered another interesting thing - apparently
> under the XCODE build environment on Mac, sizeof(wchar_t) is, in fact,
> 4, so sending WString data actually entails a great deal of overhead,
> as each 4-byte wchar_t must be copied to/from a 2-byte UniChar during
> marshaling and unmarshaling.  There's apparently a whole can of worms
> associated with sizeof(wchar_t) being 4 on Mac, since Apple's own
> Unicode implementation (CFString), uses UTF-16, effectively rendering
> wchar_t useless on Mac OS.  I was relieved to find, in
> "local_config.h", a way of forcing the omniORB build to define
> CORBA::WChar as a 2-byte entity.  By doing that, I'm hoping to be able
> to support native Unicode strings, but the question above still holds
> for all of our existing IDL's which use 1-byte strings.

wchar_t is 4 on most Unix platforms. You can avoid the overhead of
translating it to UTF-16 for marshalling by linking with the codesets
library and using UCS-4 as the transmission codeset. That has the
alternative overhead of sending twice as much data over the network, so
which is best depends on whether you have a fast network or a fast
processor.

Cheers,

Duncan.

-- 
 -- Duncan Grisby         --
  -- duncan at grisby.org     --
   -- http://www.grisby.org --



More information about the omniORB-list mailing list