Commit 92937b93 authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

git-svn-id:...

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@63218 954022d7-b5bf-4e40-9824-e11837661b57
parent 92bc9b54
......@@ -39,25 +39,13 @@ namespace ZLibZipUtils
}
static std::wstring ascii_to_unicode(const char *src)
{
size_t nSize = mbstowcs(0, src, 0);
wchar_t* pBuffer = new wchar_t[nSize];
nSize = mbstowcs(pBuffer, src, nSize);
std::wstring sRes;
if (nSize != (size_t)-1)
sRes = std::wstring(pBuffer, nSize);
delete[] pBuffer;
return sRes;
std::string sAnsi(src);
return std::wstring(sAnsi.begin(), sAnsi.end());
}
static std::string unicode_to_ascii(const wchar_t *src)
{
size_t nSize = wcstombs(0, src, 0);
char* pBuffer = new char[nSize];
nSize = wcstombs(pBuffer, src, nSize);
std::string sRes;
if (nSize != (size_t)-1)
sRes = std::string(pBuffer, nSize);
delete[] pBuffer;
return sRes;
std::wstring sUnicode(src);
return std::string(sUnicode.begin(), sUnicode.end());
}
/*This static functions are copies from ZLib miniunz.c with some changes.*/
static std::wstring codepage_issue_fixFromOEM( const char* sVal)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment