File: codepage.h

package info (click to toggle)
librime 1.13.1%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 7,896 kB
  • sloc: cpp: 34,796; ansic: 2,519; javascript: 443; sh: 225; makefile: 125
file content (17 lines) | stat: -rw-r--r-- 389 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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_ */