MCPcopy Create free account
hub / github.com/CelestiaProject/Celestia / WStringToString

Function WStringToString

src/celutil/winutil.cpp:75–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75string WStringToString(UINT codePage, const wstring& ws)
76{
77 if (ws.empty())
78 return string();
79 // get a converted string length
80 int len = WideCharToMultiByte(codePage, 0, ws.c_str(), ws.length(), NULL, 0, NULL, NULL);
81 string out(len, 0);
82 WideCharToMultiByte(codePage, 0, ws.c_str(), ws.length(), &out[0], len, NULL, NULL);
83 return out;
84}
85
86wstring StringToWString(UINT codePage, const string& s)
87{

Callers 2

WideToCurrentCPFunction · 0.85
WideToUTF8Function · 0.85

Calls 2

emptyMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected