From: Maycon Date: Fri, 24 Apr 2026 15:22:35 +0000 (-0300) Subject: ui: replace non-BMP braille char U+1FB10 with U+28FF X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=b778acdf3ba1dc18e7e4bbd8babba30b036f41ea;p=thirdparty%2Fmtr.git ui: replace non-BMP braille char U+1FB10 with U+28FF 🮐 (U+1FB10) lives outside the Basic Multilingual Plane and requires a UTF-16 surrogate pair when wchar_t is 16 bits (Windows, Cygwin). Passing a surrogate pair to wide-char ncurses functions produces corrupted output on those platforms. Replace all three uses with ⣿ (U+28FF), the filled braille pattern, which is the visually closest BMP character and avoids the issue on any platform where sizeof(wchar_t) == 2. --- diff --git a/ui/curses.c b/ui/curses.c index 9c0d458..6355eae 100644 --- a/ui/curses.c +++ b/ui/curses.c @@ -73,7 +73,7 @@ static int scale[NUM_FACTORS]; static char block_map[NUM_FACTORS]; #ifdef WITH_BRAILLE_DISPLAY static const wchar_t *braille_map[NUM_FACTORS] = { - L"⣀", L"⣀", L"⣤", L"⣤", L"⣶", L"⣶", L"⣿", L"🮐" + L"⣀", L"⣀", L"⣤", L"⣤", L"⣶", L"⣶", L"⣿", L"⣿" }; #endif @@ -651,7 +651,7 @@ static const wchar_t *braille_char_lookup( int i = scale_ms_to_braille_factor(ms); if ((unsigned)i >= 4) - return L"🮐"; // this is the max + return L"⣿"; // max (U+28FF stays in BMP, safe on 16-bit wchar_t) return braille_set[i]; } @@ -693,7 +693,7 @@ static const wchar_t *braille_char_double( int left_i = scale_ms_to_braille_factor(left_ms); if ((unsigned)left_i >= 4) - return L"🮐"; // this is the max + return L"⣿"; // max (U+28FF stays in BMP, safe on 16-bit wchar_t) return braille_char_lookup(right_ms, braille_double_lookup[left_i]); }