WString: convert from (native) UTF-16 LE to UTF-16 BE]

WString: convert from (native) UTF-16 LE to UTF-16 BE]

Post by Uwe J?ge » Wed, 27 Nov 2002 23:05:14



Hi,

basically everything seems to be correct and working. It seems to me
that I only have to swap the bytes before they are transfered. Since we
don't need the complete negotiation and translation implementation (as
far as I can see), I'll look for a "smaller" solution to my problem e.g.
swap the bytes "manually".

Kind regards
Uwe

 > Hi Uwe,
 >
 > I have recently completed implementation of codeset negotiation &
 > translation. Unfortunately this work was done for an OCI customer using
 > a private branch of TAO. I will port the codeset work to TAO 1.3.x as
 > soon as Bala opens the floodgates for new features.
 >
 > I would be willing to do the port in advance for you as a for-fee task.
 > The new codeset feature involves touching about 65 existing files in ACE
 > and TAO, as well as adding about 25 new ones. That is why I am waiting!
 >
 > This feature is designed precisely for your problem. Using negotiated
 > codesets, each process will have a Native Code Set defined for chars and
 > wchars. Then one side or the other (or both) will have a collection of
 > translators which are able to convert from the native codeset to some
 > other codeset. There are separate translators for char and wchar
 > codesets.
 >
 > If you need this right away, please let me know. I'm thinking it will
 > take about 2 to 3 weeks of effort & testing to prepare a 1.2.6+ patch
 > and then carry that
 > forward to commit post 1.3.1.
 >
 > Take care,
 > Phil
 >

 >
 >>Hi,
 >>
 >>we use TAO on Microsoft Windows for a C++ client and Jacorb as our
 >>serverside orb. Due to the resitrictions of the string type, we have to
 >>use wstring in our interfaces.
 >>Unfortunately windows uses UTF-16 little endian for their unicode
 >>implementation and CORBA uses big endian by default. Is there a easy way
 >>to either tell TAO to convert the strings from little endian to big
 >>endian? How can I use the converters build into TAO
 >>(orb_core->from_unicode etc.)? Is there a simple example somewhere?
 >>
 >>Kind regards
 >>Uwe
 >
 >
 > --
 > Phil Mesnier
 > Principal Software Engineer,    http://www.ociweb.com
 > Object Computing, Inc.          +01.314.579.0066

 
 
 

WString: convert from (native) UTF-16 LE to UTF-16 BE]

Post by Phil Mesnie » Wed, 27 Nov 2002 23:58:48


Hi,


> Hi,

> basically everything seems to be correct and working. It seems to me
> that I only have to swap the bytes before they are transfered. Since we
> don't need the complete negotiation and translation implementation (as
> far as I can see), I'll look for a "smaller" solution to my problem e.g.
> swap the bytes "manually".

I see. If you want to do this on your own, I suggest that you take a
look at the ACE_CDR input/output streams as the means for inserting a
byte swapper. As I recall, UTF-16 is supposed to be encoded with a
byte-order marker preceding any encoded wchar or wstring data. You can
use this to determine if a swap is necessary.

In ace/CDR_Stream.h, you will see the interface for the wchar translator
class that you should implement in order to do the test and byteswap.
Then take a look in TAO/ORB_Core and load your translator for the
to_unicode_ and from_unicode_ members. Currently these translators are
null. If you grep for IBM1047 you can see how its done for 8-bit chars.

Once the compliant codeset feature is in, you will be able to use the
same translator.

Good luck.
Phil

--
Phil Mesnier
Principal Software Engineer,    http://www.ociweb.com
Object Computing, Inc.          +01.314.579.0066

 
 
 

1. WString: convert from (native) UTF-16 LE to UTF-16 BE

Hi,

we use TAO on Microsoft Windows for a C++ client and Jacorb as our
serverside orb. Due to the resitrictions of the string type, we have to
use wstring in our interfaces.
Unfortunately windows uses UTF-16 little endian for their unicode
implementation and CORBA uses big endian by default. Is there a easy way
to either tell TAO to convert the strings from little endian to big
endian? How can I use the converters build into TAO
(orb_core->from_unicode etc.)? Is there a simple example somewhere?

Kind regards
Uwe

2. Help on Cisco PIX-520

3. Does TAO support UTF-16 codeset?

4. Have U deployed Win95 across UR users desktops ?

5. VRC-16-CA (16" Colour Monitour) - HELP!

6. I NEED HELP!

7. HELP-need job translated in 16 spoken languages

8. Help wanted:Powercomputing+SonetG3+OS9?

9. Fortune 32:16 Manuals

10. 32-bit or 16-bit?

11. 16 track HP backup tapes any one intrested

12. Fortune 32:16 Boot Disks Needed

13. acer 1100 speedup from 16 to 20 mhz