Merge remote-tracking branch 'origin/hotfix/v5.2.5' into develop

This commit is contained in:
ElenaSubbotina
2018-12-13 12:15:05 +03:00
68 changed files with 778 additions and 393 deletions

View File

@ -283,7 +283,7 @@ namespace NSStringExt
return pUnicodes;
}
unsigned short* CConverter::GetUtf16FromUnicode(const std::wstring& wsUnicodeText, unsigned int& unLen)
unsigned short* CConverter::GetUtf16FromUnicode(const std::wstring& wsUnicodeText, unsigned int& unLen, const bool& bIsLE)
{
unsigned int unTextLen = (unsigned int)wsUnicodeText.size();
if (unTextLen <= 0)
@ -338,6 +338,18 @@ namespace NSStringExt
}
}
if (!bIsLE)
{
unsigned char* pDataReverce = (unsigned char*)pUtf16;
unsigned int unLen2 = unLen << 1;
for (unsigned int i = 0; i < unLen2; i += 2)
{
unsigned char tmp = pDataReverce[i];
pDataReverce[i] = pDataReverce[i + 1];
pDataReverce[i + 1] = tmp;
}
}
return pUtf16;
}
}