You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gt: Fix UTF-8 console output cursor position calculation
The fix add the `hb_cdpUTF8CharWidth` function in `cdpapi.c` to check
the GT driver's `fWideCharWidth` flag. When enabled, it uses the `mk_wcwidth`
function from the public domain implementation for accurate Unicode TR11
width calculation. When disabled, it returns the default width of 1 for
backward compatibility.
- Add HB_GTI_WIDECHARWIDTH switch, disabled by default for zero overhead
- Only activate width calculation when user calls
hb_gtInfo(HB_GTI_WIDECHARWIDTH,.T.)
- Based on public-domain mk_wcwidth; supports narrow(1)/wide(2)/zero(0)
- 100% backward compatible, no binary bloat
- Fixes cursor mis-alignment in UTF-8 terminals with CJK/Emoji
Usage:
hb_cdpSelect("UTF8EX")
hb_gtInfo(HB_GTI_WIDECHARWIDTH,.T.) && enable
0 commit comments