| 4045 | } |
| 4046 | #else |
| 4047 | PUGI__FN char* convert_path_heap(const wchar_t* str) |
| 4048 | { |
| 4049 | assert(str); |
| 4050 | |
| 4051 | // first pass: get length in utf8 characters |
| 4052 | size_t length = wcslen(str); |
| 4053 | size_t size = as_utf8_begin(str, length); |
| 4054 | |
| 4055 | // allocate resulting string |
| 4056 | char* result = static_cast<char*>(xml_memory::allocate(size + 1)); |
| 4057 | if (!result) |
| 4058 | return 0; |
| 4059 | |
| 4060 | // second pass: convert to utf8 |
| 4061 | as_utf8_end(result, size, str, length); |
| 4062 | |
| 4063 | return result; |
| 4064 | } |
| 4065 | |
| 4066 | PUGI__FN FILE* open_file_wide(const wchar_t* path, const wchar_t* mode) |
| 4067 | { |
no test coverage detected