Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skipping prohibited unicode instead of erroring #2773

Open
lokxii opened this issue Mar 29, 2024 · 4 comments
Open

Skipping prohibited unicode instead of erroring #2773

lokxii opened this issue Mar 29, 2024 · 4 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Milestone

Comments

@lokxii
Copy link

lokxii commented Mar 29, 2024

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 lokxii added documentation Improvements or additions to documentation enhancement New feature or request labels Mar 29, 2024
@dankamongmen dankamongmen self-assigned this Mar 31, 2024
@dankamongmen dankamongmen added this to the 3.1.0 milestone Mar 31, 2024
@dankamongmen
Copy link
Owner

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...?

@lokxii
Copy link
Author

lokxii commented Apr 1, 2024

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.

@dankamongmen
Copy link
Owner

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

@dankamongmen
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants