Skip to content

Commit

Permalink
Revert previous print fix, add code page change
Browse files Browse the repository at this point in the history
  • Loading branch information
noah- committed Jun 15, 2018
1 parent 17c62c1 commit 8ffc6b5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion Core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ void Print(const char * szFormat, ...)
for(list<string>::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;
}
Expand Down
2 changes: 1 addition & 1 deletion D2BS.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#define XP_WIN

#define D2BS_VERSION "1.5.1868"
#define D2BS_VERSION "1.5.1869"

#include <windows.h>
#include <vector>
Expand Down
8 changes: 4 additions & 4 deletions Helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 8ffc6b5

Please sign in to comment.