notcurses icon indicating copy to clipboard operation
notcurses copied to clipboard

Skipping prohibited unicode instead of erroring

Open lokxii opened this issue 2 years ago • 4 comments

Currently printing string that contains prohibited unicode will result an error and stop printing (the error log pointed me to this line). Would it be better to skip the character and logwarn (or other level of logging) that the function skipped it?

lokxii avatar Mar 29 '24 15:03 lokxii

yeah, i've thought about this. the problem is that it's really hard to indicate to the caller that there were elided glyphs, or where they were. perhaps an option, though...?

dankamongmen avatar Mar 31 '24 23:03 dankamongmen

The problem with stopping at prohibited unicode is that I will have to sanitize the string myself before passing to notcurses, which would duplicate the utf8 checks.

Maybe an option would be good. Maybe you can also consider putting all the alignment and styling options in an option struct? This would be a breaking change tho. Just a random suggestion.

lokxii avatar Apr 01 '24 10:04 lokxii

yep, something like that. i'm pondering what to do. open to suggestions!

dankamongmen avatar Apr 01 '24 10:04 dankamongmen

i feel this would be a toplevel option rather than a per-call deal.

dankamongmen avatar Apr 01 '24 10:04 dankamongmen