In function mvccwaddnstr, the output truncation needs to handle the case when output is UTF-8 -- simple byte length truncation is not correct or accurate.
There are two issues here. The first issue is that the current byte truncation can leave invalid UTF-8 sequences. The second (and more difficult) issue is that byte truncation is simply not accurate for UTF-8 due to zero-width characters, and something like wcswidth is needed.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Checked in changes to CVS trying to fix first issue.
----
Add global gui8 flag if display output encoding is UTF-8.
New function zs_chop.
Revised mvccwaddnstr to call find_prev_char to avoid chopping
string into illegal UTF-8 output.
----
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=1195173
Originator: YES
There are two issues here. The first issue is that the current byte truncation can leave invalid UTF-8 sequences. The second (and more difficult) issue is that byte truncation is simply not accurate for UTF-8 due to zero-width characters, and something like wcswidth is needed.
Logged In: YES
user_id=1195173
Originator: YES
Checked in changes to CVS trying to fix first issue.
----
Add global gui8 flag if display output encoding is UTF-8.
New function zs_chop.
Revised mvccwaddnstr to call find_prev_char to avoid chopping
string into illegal UTF-8 output.
----