Hi,
Is there a wide character version of WSABUF structure in winsock?
I want to write Japanese data on the socket.
Hi,
Is there a wide character version of WSABUF structure in winsock?
I want to write Japanese data on the socket.
Probably not. You most likely need to convert your wide character string into some other format, such as UTF7 or something, and send that over the wire then convert back on the other side.
As another answer states, WSABUF
uses char *
to represent bytes.
TCP provides a stream of bytes it's up to you to decide what those bytes consist of. So, as long as you're providing some kind of protocol framing so that you can read the correct amount of data at the far end, just cast your wide string to a char *
.
If you were to follow your question through to its logical conclusion you'd next be asking where the WSABUF
that supports PNG images is, or the WSABUF
that supports your favourite data structure. It's up to you to translate the data that you have to a stream of bytes (which, in the case of a wide character string, is simply framing and casting).