This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[newlib-cygwin] cygwin: clear screen using wide char function;h=9374e7f65df467e0816736b5668ba151c69bc5f3

commit 9374e7f65df467e0816736b5668ba151c69bc5f3
Author: Corinna Vinschen <>
Date:   Mon Jul 31 11:43:35 2017 +0200

    cygwin: clear screen using wide char function
    FillConsoleOutputCharacterA doesn't work correctly in codepage 65001
    (UTF-8).  Looks like the character conversion function from ascii char
    to unicode char works incorrectly then.  Use FillConsoleOutputCharacterW
    Signed-off-by: Corinna Vinschen <>

 winsup/cygwin/ | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/winsup/cygwin/ b/winsup/cygwin/
index 3e17fd9..bf4366a 100644
--- a/winsup/cygwin/
+++ b/winsup/cygwin/
@@ -1319,7 +1319,7 @@ dev_console::clear_screen (HANDLE h, int x1, int y1, int x2, int y2)
       tlc.X = x2;
       tlc.Y = y2;
-  FillConsoleOutputCharacterA (h, ' ', num, tlc, &done);
+  FillConsoleOutputCharacterW (h, L' ', num, tlc, &done);
   FillConsoleOutputAttribute (h, current_win32_attr, num, tlc, &done);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]