| 28 | |
| 29 | |
| 30 | shared_ptr<char> WcharMbcsConverter::wchar2char(const wchar_t* wcStr) |
| 31 | { |
| 32 | |
| 33 | shared_ptr<char> multiByteStr; |
| 34 | |
| 35 | int len = WideCharToMultiByte(CP_UTF8, 0, wcStr, -1, NULL, 0, NULL, NULL); |
| 36 | |
| 37 | if (len > 0) |
| 38 | { |
| 39 | multiByteStr.reset(new char[len]); |
| 40 | WideCharToMultiByte(CP_UTF8, 0, wcStr, -1, multiByteStr.get(), len, NULL, NULL); |
| 41 | } |
| 42 | else |
| 43 | { |
| 44 | multiByteStr.reset(new char[1]); |
| 45 | multiByteStr.get()[0] = 0; |
| 46 | } |
| 47 | |
| 48 | return multiByteStr; |
| 49 | } |
| 50 | |
| 51 | |
| 52 | shared_ptr<TCHAR> WcharMbcsConverter::char2tchar(const char* mbStr) |
nothing calls this directly
no outgoing calls
no test coverage detected