|
|
@ -483,12 +483,12 @@ SPDLOG_INLINE void utf8_to_wstrbuf(string_view_t str, wmemory_buf_t &target) {
|
|
|
|
|
|
|
|
|
|
|
|
// find the size to allocate for the result buffer
|
|
|
|
// find the size to allocate for the result buffer
|
|
|
|
int result_size =
|
|
|
|
int result_size =
|
|
|
|
::MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str.data(), str_size, NULL, 0);
|
|
|
|
::MultiByteToWideChar(CP_UTF8, 0, str.data(), str_size, NULL, 0);
|
|
|
|
|
|
|
|
|
|
|
|
if (result_size > 0) {
|
|
|
|
if (result_size > 0) {
|
|
|
|
target.resize(result_size);
|
|
|
|
target.resize(result_size);
|
|
|
|
result_size = ::MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str.data(), str_size,
|
|
|
|
result_size = ::MultiByteToWideChar(CP_UTF8, 0, str.data(), str_size, target.data(),
|
|
|
|
target.data(), result_size);
|
|
|
|
result_size);
|
|
|
|
if (result_size > 0) {
|
|
|
|
if (result_size > 0) {
|
|
|
|
assert(result_size == target.size());
|
|
|
|
assert(result_size == target.size());
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|