utf-16.cpp revision 13493ab7596e827b8d0caab2c89e635dd65f78f9
153N/A * available from http://www.virtualbox.org. This file is free software;
RTStrAssertMsgFailed(("Lone UTF-16 trail surrogate: %#x (%.*Rhxs)\n", wc, RT_MIN(cwc * 2, 10), pwsz));
return VERR_INVALID_UTF16_ENCODING;
return VERR_INVALID_UTF16_ENCODING;
return VERR_INVALID_UTF16_ENCODING;
cCodePoints++;
if (pcwcActual)
return VINF_SUCCESS;
if (pwszString)
if (pwsz)
return pwsz;
RTDECL(int) RTUtf16DupExTag(PRTUTF16 *ppwszString, PCRTUTF16 pwszString, size_t cwcExtra, const char *pszTag)
if (pwsz)
return VINF_SUCCESS;
return VERR_NO_MEMORY;
if (!pwszString)
while (*pwsz)
pwsz++;
if (!pwsz1)
if (!pwsz2)
return iDiff;
pwsz1++;
pwsz2++;
AssertReturn(!(fFlags & ~(RTSTR_VALIDATE_ENCODING_ZERO_TERMINATED | RTSTR_VALIDATE_ENCODING_EXACT_LENGTH)),
cwcActual++;
return rc;
RTDECL(ssize_t) RTUtf16PurgeComplementSet(PRTUTF16 pwsz, PCRTUNICP puszValidSet, char chReplacement)
if (!Cp)
if (!*pCp)
return cReplacements;
while (cwc > 0)
if (!wc)
cch++;
if (cwc <= 0)
return rc;
while (cwc > 0)
if (!wc)
cch--;
if (cwc <= 0)
return rc;
if (pszResult)
return rc;
return rc;
RTDECL(int) RTUtf16ToUtf8ExTag(PCRTUTF16 pwszString, size_t cwcString, char **ppsz, size_t cch, size_t *pcch, const char *pszTag)
if (pcch)
bool fShouldFree;
char *pszResult;
fShouldFree = false;
return VERR_BUFFER_OVERFLOW;
fShouldFree = true;
if (pszResult)
return rc;
if (fShouldFree)
return rc;
if (pcch)
return rc;
return wc;
return uc;
return RTUNICP_INVALID;
(*ppwsz)++;
return VINF_SUCCESS;
int rc;
return VINF_SUCCESS;
(*ppwsz)++;
return rc;
return pwsz;
return pwsz;
return pwsz;