Commit 9830c528 authored by Victor Zverovich's avatar Victor Zverovich

Fix UTF8ToUTF16.

parent 73d98d5d
...@@ -176,12 +176,12 @@ fmt::internal::UTF8ToUTF16::UTF8ToUTF16(fmt::StringRef s) { ...@@ -176,12 +176,12 @@ fmt::internal::UTF8ToUTF16::UTF8ToUTF16(fmt::StringRef s) {
CP_UTF8, MB_ERR_INVALID_CHARS, s.c_str(), -1, 0, 0); CP_UTF8, MB_ERR_INVALID_CHARS, s.c_str(), -1, 0, 0);
static const char ERROR[] = "cannot convert string from UTF-8 to UTF-16"; static const char ERROR[] = "cannot convert string from UTF-8 to UTF-16";
if (length == 0) if (length == 0)
ThrowSystemError(GetLastError(), ERROR); ThrowWinError(GetLastError(), ERROR);
buffer_.resize(length); buffer_.resize(length);
length = MultiByteToWideChar( length = MultiByteToWideChar(
CP_UTF8, MB_ERR_INVALID_CHARS, s.c_str(), -1, &buffer_[0], length); CP_UTF8, MB_ERR_INVALID_CHARS, s.c_str(), -1, &buffer_[0], length);
if (length == 0) if (length == 0)
ThrowSystemError(GetLastError(), ERROR); ThrowWinError(GetLastError(), ERROR);
} }
fmt::internal::UTF16ToUTF8::UTF16ToUTF8(fmt::WStringRef s) { fmt::internal::UTF16ToUTF8::UTF16ToUTF8(fmt::WStringRef s) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment