https://gitlab.synchro.net/main/sbbs/-/commit/dbc654505f7d822a8ece7c0d
Modified Files:
docs/v322_new.md src/sbbs3/con_out.cpp terminal.cpp
Log Message:
Count UTF-8 columns once, in Terminal::utf8_increment()
outcp() wrote the codepoint with term_out() and then advanced the column itself, but term_out() -> parse_output() -> Terminal::utf8_increment()
had already counted it -- so every codepoint outcp() emitted to a UTF-8 terminal advanced the column counter by twice the glyph's display width.
The counter ran ahead of the cursor, making word-wrap, right-margin
truncation, centering and the auto-pause line counter wrap early on any
line containing such text. The call was also unconditional while
term_out() returns early under CON_ECHO_OFF, so the column advanced for suppressed output too.
utf8_increment() is now the only place that counts, and it passes sbbs->unicode_zerowidth rather than a hardcoded 0, preserving the
zero-width quirk the ZWNBSP probe detects at logon. That applies the
detected value to all UTF-8 output, bputs() included, not just outcp().
outcp()'s inc_column() was correct when written in 9374bfe37e
(pill-4-pencil): it paired with putcom(), which does no column
accounting. It became a double-count in 374282bf81 (skins-28-shop),
which switched the write to term_out() and introduced utf8_increment().
Fixes #1200
Co-Authored-By: Claude Opus 5 (1M context) <
noreply@anthropic.com>
--- SBBSecho 3.37-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)