I am writing a C++ application that is using boost::asio for some http operations. I chose boost::asio assuming it is fully unicode compliant. However, I am unable compi开发者_开发问答le in UNICODE because some part of asio is hardcoded to char.
Case in point:
#ifndef TCHAR
#ifdef _UNICODE
#define TCHAR wchar_t
#else
#define TCHAR char
#endif
#endif
// The following lines only complile in MBCS and not in UNICODE.
boost::asio::basic_streambuf<std::allocator<TCHAR> > request;
std::basic_ostream<TCHAR, std::char_traits<TCHAR> > requestStream(&request);
The boost::asio::read_until function accepts char as a delimiter. Am I doing something wrong here? Please note I am new to unicode, never needed it before.
boost::asio::basic_streambuf derives from std::streambuf instead of std::basic_streambuf, so I suspect boost::asio is not really UNICODE compliant.
Correct, boost::asio is not UNICODE compliant.
精彩评论