Commit 7a74153a by Abseil Team Committed by Copybara-Service

Import of CCTZ from GitHub.

PiperOrigin-RevId: 537825067
Change-Id: I3ce8712d5130068fb7d77b563eb502e2e9560810
parent 77ba7ca9
...@@ -148,11 +148,12 @@ std::string win32_local_time_zone(const HMODULE combase) { ...@@ -148,11 +148,12 @@ std::string win32_local_time_zone(const HMODULE combase) {
UINT32 wlen; UINT32 wlen;
const PCWSTR tz_wstr = windows_get_string_raw_buffer(tz_hstr, &wlen); const PCWSTR tz_wstr = windows_get_string_raw_buffer(tz_hstr, &wlen);
if (tz_wstr) { if (tz_wstr) {
const int size = WideCharToMultiByte(CP_UTF8, 0, tz_wstr, wlen, nullptr, const int size =
0, nullptr, nullptr); WideCharToMultiByte(CP_UTF8, 0, tz_wstr, static_cast<int>(wlen),
result.resize(size); nullptr, 0, nullptr, nullptr);
WideCharToMultiByte(CP_UTF8, 0, tz_wstr, wlen, &result[0], size, nullptr, result.resize(static_cast<size_t>(size));
nullptr); WideCharToMultiByte(CP_UTF8, 0, tz_wstr, static_cast<int>(wlen),
&result[0], size, nullptr, nullptr);
} }
windows_delete_string(tz_hstr); windows_delete_string(tz_hstr);
} }
......
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