mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Added code page setting for the console window
This commit is contained in:
@@ -906,3 +906,6 @@ ConsoleWindow=0
|
|||||||
|
|
||||||
;Console window position and size data. Do not modify
|
;Console window position and size data. Do not modify
|
||||||
ConsoleWindowData=
|
ConsoleWindowData=
|
||||||
|
|
||||||
|
;Set the code page for the console window (Default is your system code page)
|
||||||
|
ConsoleCodePage=0
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ public:
|
|||||||
static constexpr char* IniSection = "Debugging";
|
static constexpr char* IniSection = "Debugging";
|
||||||
static constexpr char* IniModeKey = "ConsoleWindow";
|
static constexpr char* IniModeKey = "ConsoleWindow";
|
||||||
static constexpr char* IniPositionKey = "ConsoleWindowData";
|
static constexpr char* IniPositionKey = "ConsoleWindowData";
|
||||||
|
static constexpr char* IniCodePageKey = "ConsoleCodePage";
|
||||||
|
|
||||||
static ConsoleWindow& instance() { return _instance; }
|
static ConsoleWindow& instance() { return _instance; }
|
||||||
|
|
||||||
@@ -137,6 +138,9 @@ void ConsoleWindow::init() {
|
|||||||
dlog_f("Failed to allocate console: 0x%x\n", DL_MAIN, GetLastError());
|
dlog_f("Failed to allocate console: 0x%x\n", DL_MAIN, GetLastError());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
int cp = IniReader::GetIntDefaultConfig(IniSection, IniCodePageKey, 0);
|
||||||
|
if (cp > 0) SetConsoleOutputCP(cp);
|
||||||
|
|
||||||
freopen("CONOUT$", "w", stdout); // this allows to print to console via std::cout
|
freopen("CONOUT$", "w", stdout); // this allows to print to console via std::cout
|
||||||
|
|
||||||
if (_mode & ConsoleSource::GAME) {
|
if (_mode & ConsoleSource::GAME) {
|
||||||
|
|||||||
Reference in New Issue
Block a user