| 30 | } |
| 31 | |
| 32 | wchar_t* kwsysEncoding_DupToWide(char const* str) |
| 33 | { |
| 34 | wchar_t* ret = NULL; |
| 35 | size_t length = kwsysEncoding_mbstowcs(NULL, str, 0) + 1; |
| 36 | if (length > 0) { |
| 37 | ret = (wchar_t*)malloc((length) * sizeof(wchar_t)); |
| 38 | if (ret) { |
| 39 | ret[0] = 0; |
| 40 | kwsysEncoding_mbstowcs(ret, str, length); |
| 41 | } |
| 42 | } |
| 43 | return ret; |
| 44 | } |
| 45 | |
| 46 | size_t kwsysEncoding_wcstombs(char* dest, wchar_t const* str, size_t n) |
| 47 | { |
searching dependent graphs…