mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-20 08:58:00 +02:00
SetConsoleOutputCP(CP_UTF8)
This commit is contained in:
parent
8d6a29c16a
commit
080dadb24b
1 changed files with 6 additions and 0 deletions
|
@ -81,6 +81,8 @@ namespace System
|
||||||
return terminate ? false : true;
|
return terminate ? false : true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//SetConsoleOutputCP set to CP_UTF8
|
||||||
|
|
||||||
[CLink, CallingConvention(.Stdcall)]
|
[CLink, CallingConvention(.Stdcall)]
|
||||||
static extern Windows.IntBool SetConsoleTextAttribute(Windows.Handle hConsoleOutput, uint16 wAttributes);
|
static extern Windows.IntBool SetConsoleTextAttribute(Windows.Handle hConsoleOutput, uint16 wAttributes);
|
||||||
|
|
||||||
|
@ -90,6 +92,9 @@ namespace System
|
||||||
[CLink, CallingConvention(.Stdcall)]
|
[CLink, CallingConvention(.Stdcall)]
|
||||||
static extern Windows.Handle GetStdHandle(uint32 nStdHandle);
|
static extern Windows.Handle GetStdHandle(uint32 nStdHandle);
|
||||||
|
|
||||||
|
[CLink, CallingConvention(.Stdcall)]
|
||||||
|
static extern Windows.IntBool SetConsoleOutputCP(uint32 wCodePageID);
|
||||||
|
|
||||||
[CallingConvention(.Stdcall)]
|
[CallingConvention(.Stdcall)]
|
||||||
function Windows.IntBool ConsoleCtrlHandler(int32 ctrlType);
|
function Windows.IntBool ConsoleCtrlHandler(int32 ctrlType);
|
||||||
[CLink, CallingConvention(.Stdcall)]
|
[CLink, CallingConvention(.Stdcall)]
|
||||||
|
@ -111,6 +116,7 @@ namespace System
|
||||||
sOriginalForegroundColor.ConsoleTextAttribute = (uint8)(consoleInfo.mAttributes & 0xF);
|
sOriginalForegroundColor.ConsoleTextAttribute = (uint8)(consoleInfo.mAttributes & 0xF);
|
||||||
sOriginalBackgroundColor.ConsoleTextAttribute = (uint8)(consoleInfo.mAttributes >> 4);
|
sOriginalBackgroundColor.ConsoleTextAttribute = (uint8)(consoleInfo.mAttributes >> 4);
|
||||||
}
|
}
|
||||||
|
SetConsoleOutputCP(/*CP_UTF8*/65001);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue