MCPcopy Create free account
hub / github.com/ashkulz/NppFTP / cvtcpy

Method cvtcpy

UTCP/src/UT_StrOp.cpp:33–41  ·  view source on GitHub ↗

In calling cvtcpy, allocate _tcslen + 1 of source for dest, and pass _tcslen as size.

Source from the content-addressed store, hash-verified

31#if defined _UNICODE
32// In calling cvtcpy, allocate _tcslen + 1 of source for dest, and pass _tcslen as size.
33void CUT_Str::cvtcpy(wchar_t * dest, size_t size, const char * source, UINT codePage)
34{
35 // now using MultiByteToWideChar to enable code page specification
36 *dest = _T('\0');
37 int count = MultiByteToWideChar(codePage, 0, source, -1, dest, (int)size);
38 if (count == 0) {
39 *(dest+size) = _T('\0'); // v4.2 helps for ATL CString sources
40 }
41}
42void CUT_Str::cvtcpy(char * dest, size_t size, const wchar_t * source)
43{
44 *dest = '\0';

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected