FX_STRSIZE FX_WideString_GetNormalization(const CFX_WideStringC& wsSrc,
                                          FX_WCHAR* pDst) {
  FX_STRSIZE nCount = 0;
  for (FX_STRSIZE len = 0; len < wsSrc.GetLength(); len++) {
    FX_WCHAR wch = wsSrc.GetAt(len);
    if (pDst) {
      nCount += FX_Unicode_GetNormalization(wch, pDst + nCount);
    } else {
      nCount += FX_Unicode_GetNormalization(wch, pDst);
    }
  }
  return nCount;
}
示例#2
0
void NormalizeCompositeChar(FX_WCHAR wChar, CFX_WideString& sDest)
{
    wChar = FX_GetMirrorChar(wChar, TRUE, FALSE);
    FX_LPWSTR pDst = NULL;
    FX_STRSIZE nCount = FX_Unicode_GetNormalization(wChar, pDst);
    if (nCount < 1 ) {
        sDest += wChar;
        return;
    }
    pDst = new FX_WCHAR[nCount];
    FX_Unicode_GetNormalization(wChar, pDst);
    for (int nIndex = 0; nIndex < nCount; nIndex++) {
        sDest += pDst[nIndex];
    }
    delete[] pDst;
}