Re: differing sizes of wchar_t
- From: Roedy Green <look-on@xxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 25 Sep 2005 20:38:09 GMT
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.
.
- References:
- differing sizes of wchar_t
- From: Henry Townsend
- differing sizes of wchar_t
- Prev by Date: differing sizes of wchar_t
- Next by Date: Eclipse Plugin-To create a jar in Web Project when i build a Java Project
- Previous by thread: differing sizes of wchar_t
- Next by thread: Eclipse Plugin-To create a jar in Web Project when i build a Java Project
- Index(es):