Menu

#261 Need care with output truncation

open
nobody
None
5
2007-09-28
2007-09-28
elsapo
No

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.

Discussion

  • elsapo

    elsapo - 2007-09-28

    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.

     
  • elsapo

    elsapo - 2007-09-28

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

     

Log in to post a comment.