From 9830c528161f87d8a7177d3bbf4783c0d91714c4 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Thu, 1 May 2014 07:20:38 -0700 Subject: [PATCH] Fix UTF8ToUTF16. --- format.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/format.cc b/format.cc index 4d1f9ff6..ce03ab5e 100644 --- a/format.cc +++ b/format.cc @@ -176,12 +176,12 @@ fmt::internal::UTF8ToUTF16::UTF8ToUTF16(fmt::StringRef s) { 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"; if (length == 0) - ThrowSystemError(GetLastError(), ERROR); + ThrowWinError(GetLastError(), ERROR); buffer_.resize(length); length = MultiByteToWideChar( CP_UTF8, MB_ERR_INVALID_CHARS, s.c_str(), -1, &buffer_[0], length); if (length == 0) - ThrowSystemError(GetLastError(), ERROR); + ThrowWinError(GetLastError(), ERROR); } fmt::internal::UTF16ToUTF8::UTF16ToUTF8(fmt::WStringRef s) {