From 8ffc6b5d05738142bfac861967ded7695cfae5e0 Mon Sep 17 00:00:00 2001 From: Noah I Date: Thu, 14 Jun 2018 23:41:53 -0500 Subject: [PATCH] Revert previous print fix, add code page change --- Core.cpp | 1 - D2BS.h | 2 +- Helpers.cpp | 8 ++++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Core.cpp b/Core.cpp index ad5cd6ac..b15042d4 100644 --- a/Core.cpp +++ b/Core.cpp @@ -86,7 +86,6 @@ void Print(const char * szFormat, ...) for(list::iterator it = lines.begin(); it != lines.end(); ++it) { wchar_t * output = AnsiToUnicode(it->c_str()); - replace(output, output+it->length(), 0xFFFF, 0xFF); D2CLIENT_PrintGameString(output, 0); delete [] output; } diff --git a/D2BS.h b/D2BS.h index cf3e6b80..9edf7b98 100644 --- a/D2BS.h +++ b/D2BS.h @@ -5,7 +5,7 @@ #define XP_WIN -#define D2BS_VERSION "1.5.1868" +#define D2BS_VERSION "1.5.1869" #include #include diff --git a/Helpers.cpp b/Helpers.cpp index 08e52d40..1036e936 100644 --- a/Helpers.cpp +++ b/Helpers.cpp @@ -13,18 +13,18 @@ wchar_t* AnsiToUnicode(const char* str) { wchar_t* buf = NULL; - int len = MultiByteToWideChar(CP_ACP, 0, str, -1, buf, 0); + int len = MultiByteToWideChar(1252, 0, str, -1, buf, 0); buf = new wchar_t[len]; - MultiByteToWideChar(CP_ACP, 0, str, -1, buf, len); + MultiByteToWideChar(1252, 0, str, -1, buf, len); return buf; } char* UnicodeToAnsi(const wchar_t* str) { char* buf = NULL; - int len = WideCharToMultiByte(CP_ACP, 0, str, -1, buf, 0, "?", NULL); + int len = WideCharToMultiByte(1252, 0, str, -1, buf, 0, "?", NULL); buf = new char[len]; - WideCharToMultiByte(CP_ACP, 0, str, -1, buf, len, "?", NULL); + WideCharToMultiByte(1252, 0, str, -1, buf, len, "?", NULL); return buf; }