From 43d40b6d7999fe17f868a82beb2b87867f1a1bc0 Mon Sep 17 00:00:00 2001 From: Adam Saponara Date: Fri, 4 Oct 2024 19:33:51 -0400 Subject: [PATCH] `setlocale` in demo since around cd42ba3, we rely on `iswprint`, which itself is locale-dependent. callers using unicode (like the demo) must be sure to set a unicode locale prior to initializing. --- demo/keyboard.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/demo/keyboard.c b/demo/keyboard.c index d3bea77..013c6bb 100644 --- a/demo/keyboard.c +++ b/demo/keyboard.c @@ -2,6 +2,7 @@ #include #include #include +#include #include "../termbox2.h" struct key { @@ -694,6 +695,8 @@ int main(int argc, char **argv) (void) argc; (void) argv; int ret; + setlocale(LC_ALL, ""); + ret = tb_init(); if (ret) { fprintf(stderr, "tb_init() failed with error code %d\n", ret); -- 2.39.5