12#ifndef OPENVPN_WIN_UNICODE_H
13#define OPENVPN_WIN_UNICODE_H
24typedef std::unique_ptr<wchar_t[]>
UTF16;
25typedef std::unique_ptr<char[]>
UTF8;
29inline wchar_t *
utf16(
const std::string &str,
int cp = CP_UTF8)
32 const int len = ::MultiByteToWideChar(cp,
40 UTF16 ret(
new wchar_t[len]);
41 const int len2 = ::MultiByteToWideChar(cp,
57inline char *
utf8(
wchar_t *str)
60 const int len = ::WideCharToMultiByte(CP_UTF8,
70 UTF8 ret(
new char[len]);
71 const int len2 = ::WideCharToMultiByte(CP_UTF8,
#define OPENVPN_SIMPLE_EXCEPTION(C)
char * utf8(wchar_t *str)
std::unique_ptr< wchar_t[]> UTF16
size_t utf16_strlen(const wchar_t *str)
wchar_t * utf16(const std::string &str, int cp=CP_UTF8)
std::unique_ptr< char[]> UTF8