-
-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include "platform.h" | ||
|
||
#ifdef WIN32 | ||
#include <Windows.h> | ||
|
||
void platform::configure_encoding() { | ||
// set utf-8 encoding to console output | ||
SetConsoleOutputCP(CP_UTF8); | ||
setvbuf(stdout, nullptr, _IOFBF, 1000); | ||
} | ||
#else | ||
void platform::configure_encoding(){ | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#ifndef UTIL_PLATFORM_H_ | ||
#define UTIL_PLATFORM_H_ | ||
|
||
namespace platform { | ||
extern void configure_encoding(); | ||
} | ||
|
||
#endif // UTIL_PLATFORM_H_ |