MCPcopy Create free account
hub / github.com/crashfort/SourceDemoRender / ToUTF8

Method ToUTF8

Projects/Shared/Source/String.cpp:4–14  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2#include <SDR Shared\BareWindows.hpp>
3
4std::string SDR::String::ToUTF8(const std::wstring& input)
5{
6 std::string ret;
7
8 auto size = WideCharToMultiByte(CP_UTF8, 0, input.data(), input.size(), nullptr, 0, nullptr, nullptr);
9 ret.resize(size, 0);
10
11 WideCharToMultiByte(CP_UTF8, 0, input.data(), input.size(), &ret.front(), size, nullptr, nullptr);
12
13 return ret;
14}
15
16std::string SDR::String::ToUTF8(const wchar_t* input)
17{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected