Rewrite cleanText to strip zero width spaces characters #119
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a fairly hack fix for the issue that I appear to be the only one suffering from. Certain non-ascii characters cause text to get corrupted in my terminal when using glirc - when connected
All have been configured to understand and use utf-8 characters, but the zero width spaces that get included in the nicks from haskellbridge cause things get garbled. See screen shot and particularly note that the text immediately after nicks:
This problem is so bad that it affects other tmux windows when I switch between them. While other unicode characters like emojis cause problems, the prevalence of the zero width space (see https://www.unicode.org/charts/PDF/U2000.pdf - code 0x200B) is used in the haskellbridge matrix bot on Libera.chat, which causes glirc to be nearly unreadable for me when many matrix users are speaking.
I'm sure this isn't the best implementation of the fix, but I couldn't think of an appropriate character that '\8203' should be replaced with that wouldn't look strange. More than happy to implement alternatives, this is more for discussion that necessarily the final fix.