mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-08 00:06:59 -06:00
Update to 7-Zip Version 21.02
This commit is contained in:
@@ -2,7 +2,9 @@
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <tchar.h>
|
||||
#endif
|
||||
|
||||
#include "IntToString.h"
|
||||
#include "StdOutStream.h"
|
||||
@@ -11,8 +13,6 @@
|
||||
|
||||
#define kFileOpenMode "wt"
|
||||
|
||||
extern int g_CodePage;
|
||||
|
||||
CStdOutStream g_StdOut(stdout);
|
||||
CStdOutStream g_StdErr(stderr);
|
||||
|
||||
@@ -47,34 +47,29 @@ CStdOutStream & endl(CStdOutStream & outStream) throw()
|
||||
|
||||
CStdOutStream & CStdOutStream::operator<<(const wchar_t *s)
|
||||
{
|
||||
int codePage = g_CodePage;
|
||||
if (codePage == -1)
|
||||
codePage = CP_OEMCP;
|
||||
AString dest;
|
||||
if (codePage == CP_UTF8)
|
||||
ConvertUnicodeToUTF8(s, dest);
|
||||
else
|
||||
UnicodeStringToMultiByte2(dest, s, (UINT)codePage);
|
||||
return operator<<((const char *)dest);
|
||||
}
|
||||
|
||||
void StdOut_Convert_UString_to_AString(const UString &s, AString &temp)
|
||||
{
|
||||
int codePage = g_CodePage;
|
||||
if (codePage == -1)
|
||||
codePage = CP_OEMCP;
|
||||
if (codePage == CP_UTF8)
|
||||
ConvertUnicodeToUTF8(s, temp);
|
||||
else
|
||||
UnicodeStringToMultiByte2(temp, s, (UINT)codePage);
|
||||
AString temp;
|
||||
UString s2(s);
|
||||
PrintUString(s2, temp);
|
||||
return *this;
|
||||
}
|
||||
|
||||
void CStdOutStream::PrintUString(const UString &s, AString &temp)
|
||||
{
|
||||
StdOut_Convert_UString_to_AString(s, temp);
|
||||
Convert_UString_to_AString(s, temp);
|
||||
*this << (const char *)temp;
|
||||
}
|
||||
|
||||
void CStdOutStream::Convert_UString_to_AString(const UString &src, AString &dest)
|
||||
{
|
||||
int codePage = CodePage;
|
||||
if (codePage == -1)
|
||||
codePage = CP_OEMCP;
|
||||
if (codePage == CP_UTF8)
|
||||
ConvertUnicodeToUTF8(src, dest);
|
||||
else
|
||||
UnicodeStringToMultiByte2(dest, src, (UINT)codePage);
|
||||
}
|
||||
|
||||
|
||||
static const wchar_t kReplaceChar = '_';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user