https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1ffe4318274c91f7d9af117ff049598487d97227

commit 1ffe4318274c91f7d9af117ff049598487d97227
Author:     Hermès Bélusca-Maïto <[email protected]>
AuthorDate: Sun Jul 4 00:51:49 2021 +0200
Commit:     Hermès Bélusca-Maïto <[email protected]>
CommitDate: Sat Jan 15 17:41:36 2022 +0100

    [CONSRV] Trivially implement TuiSetCodePage(). CORE-17601
---
 win32ss/user/winsrv/consrv/frontends/tui/tuiterm.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/win32ss/user/winsrv/consrv/frontends/tui/tuiterm.c 
b/win32ss/user/winsrv/consrv/frontends/tui/tuiterm.c
index a3f60e3895d..e0ecef01d38 100644
--- a/win32ss/user/winsrv/consrv/frontends/tui/tuiterm.c
+++ b/win32ss/user/winsrv/consrv/frontends/tui/tuiterm.c
@@ -1131,9 +1131,17 @@ static BOOL NTAPI
 TuiSetCodePage(IN OUT PFRONTEND This,
                UINT CodePage)
 {
-    // TODO: Find a suitable console font for the given code page,
-    // and set it if found; otherwise fail the call, or fall back
-    // to some default font...
+    // PTUI_CONSOLE_DATA TuiData = This->Context;
+
+    // TODO: Verify that the console is the visible one.
+    // Only then can we change the output code page font.
+
+    if (!TuiSetConsoleOutputCP(ConsoleDeviceHandle, CodePage))
+    {
+        DPRINT1("Failed to load the font for codepage %d\n", CodePage);
+        /* Let's suppose the font is good enough to continue */
+        return FALSE;
+    }
 
     return TRUE;
 }

Reply via email to