
Okay, i sorted out that you can't use boost::asio::basic_streambuf with wide chars, but if not that, how do I send wide chars with asio? Is it even possible? Thanks.

Okay, i sorted out that you can't use boost::asio::basic_streambuf with wide chars, but if not that, how do I send wide chars with asio?
Is it even possible?
Afterall, wide char is just sequence of two chars, isn't it? Googling
around gives the following example: http://www.jroller.com/jurberg/entry/transmitting_unicode_data_between_c

Igor R:
Cain Miley:
Okay, i sorted out that you can't use boost::asio::basic_streambuf with wide chars, but if not that, how do I send wide chars with asio?
Is it even possible?
Afterall, wide char is just sequence of two chars, isn't it?
Not necessarily. It is platform-dependent. And even on two platforms where sizeof(wchar_t) would be equal, the issue of the encoding still remains. To transmit "wide" chars as a sequence of bytes, you have to take care of the various possible encodings by either: - Choosing one and only one (UTF-8 comes to mind) and convert between this encoding and whatever you want your wide chars to be encoded - Having a mechanism that the peers can use to communicate, and possibly negotiate, the encoding to use. (And I'd advise the first, the second makes things rather complex)
participants (3)
-
Cain Miley
-
Eric MALENFANT
-
Igor R