mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-12 16:11:35 -06:00
4.20
This commit is contained in:
committed by
Kornel Lesiński
parent
8c1b5c7b7e
commit
3c510ba80b
@@ -4,7 +4,11 @@
|
||||
|
||||
#include "StringConvert.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#ifndef _WIN32
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
UString MultiByteToUnicodeString(const AString &srcString, UINT codePage)
|
||||
{
|
||||
UString resultString;
|
||||
@@ -57,6 +61,14 @@ UString MultiByteToUnicodeString(const AString &srcString, UINT codePage)
|
||||
UString resultString;
|
||||
for (int i = 0; i < srcString.Length(); i++)
|
||||
resultString += wchar_t(srcString[i]);
|
||||
/*
|
||||
if(!srcString.IsEmpty())
|
||||
{
|
||||
int numChars = mbstowcs(resultString.GetBuffer(srcString.Length()), srcString, srcString.Length() + 1);
|
||||
if (numChars < 0) throw "Your environment does not support UNICODE";
|
||||
resultString.ReleaseBuffer(numChars);
|
||||
}
|
||||
*/
|
||||
return resultString;
|
||||
}
|
||||
|
||||
@@ -65,7 +77,17 @@ AString UnicodeStringToMultiByte(const UString &srcString, UINT codePage)
|
||||
AString resultString;
|
||||
for (int i = 0; i < srcString.Length(); i++)
|
||||
resultString += char(srcString[i]);
|
||||
/*
|
||||
if(!srcString.IsEmpty())
|
||||
{
|
||||
int numRequiredBytes = srcString.Length() * 6 + 1;
|
||||
int numChars = wcstombs(resultString.GetBuffer(numRequiredBytes), srcString, numRequiredBytes);
|
||||
if (numChars < 0) throw "Your environment does not support UNICODE";
|
||||
resultString.ReleaseBuffer(numChars);
|
||||
}
|
||||
*/
|
||||
return resultString;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user