Re: differing sizes of wchar_t



On Sun, 25 Sep 2005 13:56:20 -0400, Henry Townsend
<henry.townsend@xxxxxxxx> wrote or quoted :

>I guess I could pass sizeof(wchar_t)
>to the server and have it respond with 2- or 4-byte data based on that,
>but that would mean a doubling of bandwidth consumption. What do people
>usually do about this "impedance mismatch"?

How about telling C you have a stream of bytes, then taking the UTF-16
apart yourself. There was a long discussion here about how UTF-16 is
encoded.

See http://mindprod.com/jgloss/utf.html

In there anything in your C libraries equivalent to Java UTF-8
encodings? that will give you an array of 32-bit chars with an 8-bit
stream?

I do not catch whether this data is mixed binary/text or pure text.

If mixed you might use LEDataStream to prepare file that look like C
structures. It encodes the strings as counted UTF-8. You could take
those apart yourself.

I think the key to this is realising the encoding is not a big deal.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
.