Full-width characters are counted incorrectly
For example speak in a MUC with the テスト nick, it will mess with the following characters. Even worse, a long message containing such characters will display only about half of each line, the entire message being uncomprehensible. Some characters with zero-width have the opposite issue, they are counted while they shouldn’t, but it’s much less important.
The cost of counting the right length is a bit higher than just doing len() on the message, but it renders poezio unusable for speakers of languages using full-length characters. If slowdowns with the common ASCII case are very pronounced, an option could be added to revert to the wrong counting method, so that those users won’t be penalized.
- Revision 0bcd4206 by louiz on 2013-06-19T20:18:50Z:
Consider the number of columns of each characters in the poopt module Some characters take 0 columns, others take 1 or 2 (full-width characters) fixes #2142
- Revision cbe00072 by louiz on 2013-06-19T20:19:08Z:
Exposes the wcswidth function in the poopt module see #2142
- Revision 0d7fedce by louiz on 2013-06-19T20:19:17Z:
And actually use poopt.wcswidth to properly count the nicks' size see #2142