Skip to content

Commit

Permalink
VT platform in Windows : the console output is locale-dependent. So d…
Browse files Browse the repository at this point in the history
…emos now set the UTF-8 locale. SetConsoleOutputCP( 65001); is supposed to force UTF-8 output, though only for fixed-pitch Unicode fonts, but actually doesn't even do that... it appears Windows provides no programmatic way to say 'use this Unicode glyph on the console'.
  • Loading branch information
Bill-Gray committed Jul 15, 2023
1 parent d62083a commit 3b64ddc
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion demos/mbrot.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ int main( const int argc, const char **argv)
int results[5], rval;
#endif

setlocale(LC_ALL, "");
setlocale(LC_ALL, ".utf8");
for( i = 1; i < argc; i++)
if( argv[i][0] == '-')
switch( argv[i][1])
Expand Down
2 changes: 1 addition & 1 deletion demos/newtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ int main( int argc, char **argv)
unsigned unicode_offset = 0x80;
#endif

setlocale(LC_ALL, "");
setlocale(LC_ALL, ".utf8");
ttytype[0] = 25; ttytype[1] = 90; /* Allow 25 to 90 lines... */
ttytype[2] = 80; ttytype[3] = (char)127; /* ...and 80 to 127 columns */
/* (This program gets weird artifacts when smaller than 25x80.) */
Expand Down
2 changes: 1 addition & 1 deletion demos/picsview.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ int main( const int argc, const char *argv[])
bool show_help = TRUE;
SCREEN *screen_pointer;

setlocale(LC_ALL, "");
setlocale(LC_ALL, ".utf8");
for( i = 1; i < argc; i++)
if( argv[i][0] == '-')
switch( argv[i][1])
Expand Down
2 changes: 1 addition & 1 deletion demos/testcurs.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ int main(int argc, char *argv[])
int key, old_option = -1, new_option = 0, i;
bool quit = FALSE;

setlocale(LC_ALL, "");
setlocale(LC_ALL, ".utf8");

#ifdef __PDCURSESMOD__
#ifdef PDC_VER_MAJOR /* so far only seen in 4.0+ */
Expand Down
2 changes: 1 addition & 1 deletion demos/widetest.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ int main( const int argc, const char *argv[])

INTENTIONALLY_UNUSED_PARAMETER( argc);
INTENTIONALLY_UNUSED_PARAMETER( argv);
setlocale(LC_ALL, "");
setlocale(LC_ALL, ".utf8");
screen_pointer = newterm(NULL, stdout, stdin);
mvaddwstr( 1, 1, precomposed_string);
mvaddwstr( 2, 1, combining_string);
Expand Down

0 comments on commit 3b64ddc

Please sign in to comment.