Skip to content

Commit ed67b15

Browse files
aymanbagabasalexbrainman
authored andcommitted
windows: add console codepage api
Add setter/getter for console input/output codepages. This is useful to set the console expected codepage instead of converting it to UTF-16 before writing. Change-Id: Ie0465708e7cf68d776e23dbbeeca7bcb4db7d2bf GitHub-Last-Rev: 93c06e2 GitHub-Pull-Request: #206 Reviewed-on: https://go-review.googlesource.com/c/sys/+/599395 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Alex Brainman <[email protected]> Reviewed-by: Cherry Mui <[email protected]> Reviewed-by: Michael Pratt <[email protected]>
1 parent 9cb830b commit ed67b15

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

windows/syscall_windows.go

+4
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,10 @@ func NewCallbackCDecl(fn interface{}) uintptr {
313313
//sys SetConsoleMode(console Handle, mode uint32) (err error) = kernel32.SetConsoleMode
314314
//sys GetConsoleScreenBufferInfo(console Handle, info *ConsoleScreenBufferInfo) (err error) = kernel32.GetConsoleScreenBufferInfo
315315
//sys setConsoleCursorPosition(console Handle, position uint32) (err error) = kernel32.SetConsoleCursorPosition
316+
//sys GetConsoleCP() (cp uint32, err error) = kernel32.GetConsoleCP
317+
//sys GetConsoleOutputCP() (cp uint32, err error) = kernel32.GetConsoleOutputCP
318+
//sys SetConsoleCP(cp uint32) (err error) = kernel32.SetConsoleCP
319+
//sys SetConsoleOutputCP(cp uint32) (err error) = kernel32.SetConsoleOutputCP
316320
//sys WriteConsole(console Handle, buf *uint16, towrite uint32, written *uint32, reserved *byte) (err error) = kernel32.WriteConsoleW
317321
//sys ReadConsole(console Handle, buf *uint16, toread uint32, read *uint32, inputControl *byte) (err error) = kernel32.ReadConsoleW
318322
//sys resizePseudoConsole(pconsole Handle, size uint32) (hr error) = kernel32.ResizePseudoConsole

windows/zsyscall_windows.go

+38
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)