MbstowCSZ transformation causes Chinese garbled problems

xiaoxiao2021-03-06  37

Solve the conversion function in wtl cstring

Static int __cdecl _mbstowcsz (wchar_t * wcstr, const char * mbstr, size_t count)

{

IF (count == 0 && WCSTR! = null)

Return 0;

Int results = :: MultibyToWideChar (CP_ACP, 0, MBSTR, -1, WCSTR, (INT) Count;

Atlassert (WCSTR == Null || Result <= (int) count);

IF (Result> 0)

WCSTR [RESULT - 1] = 0;

Return Result;

}

转载请注明原文地址:https://www.9cbs.com/read-58573.html

New Post(0)