From f14444cfca2594784bbc16926bfb9f202ad2d760 Mon Sep 17 00:00:00 2001 From: nick black Date: Sat, 2 May 2020 16:37:01 -0400 Subject: [PATCH] multiselector: work in ASCII environment #451 --- src/lib/selector.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/selector.c b/src/lib/selector.c index 0728e4aa7..4448ebaab 100644 --- a/src/lib/selector.c +++ b/src/lib/selector.c @@ -495,7 +495,12 @@ ncmultiselector_draw(ncmultiselector* n){ if(printidx == n->current){ n->ncp->channels = (uint64_t)channels_bchannel(n->descchannels) << 32u | channels_fchannel(n->descchannels); } - ncplane_putegc_yx(n->ncp, yoff, bodyoffset, n->items[printidx].selected ? "☒" : "☐", NULL); + // FIXME this is the wrong place to do this. see https://github.com/dankamongmen/notcurses/issues/451 + if(enforce_utf8()){ + ncplane_putegc_yx(n->ncp, yoff, bodyoffset, n->items[printidx].selected ? "☒" : "☐", NULL); + }else{ + ncplane_putsimple_yx(n->ncp, yoff, bodyoffset, n->items[printidx].selected ? 'X' : '-'); + } n->ncp->channels = n->opchannels; if(printidx == n->current){ n->ncp->channels = (uint64_t)channels_bchannel(n->opchannels) << 32u | channels_fchannel(n->opchannels);