forked from rime/librime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update tools: code page switching for windows, and format tools code …
…with `clang-format -i ` (rime#721)
- Loading branch information
1 parent
8a0b9f6
commit 032dcc6
Showing
7 changed files
with
172 additions
and
110 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,17 @@ | ||
#ifndef CODEPAGE_H_ | ||
#define CODEPAGE_H_ | ||
|
||
#ifdef _WIN32 | ||
#include <windows.h> | ||
inline unsigned int SetConsoleOutputCodePage(unsigned int codepage = CP_UTF8) { | ||
unsigned int cp = GetConsoleOutputCP(); | ||
SetConsoleOutputCP(codepage); | ||
return cp; | ||
} | ||
#else | ||
inline unsigned int SetConsoleOutputCodePage(unsigned int codepage = 65001) { | ||
return 0; | ||
} | ||
#endif /* _WIN32 */ | ||
|
||
#endif /* CODEPAGE_H_ */ |
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
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
Oops, something went wrong.