• src/encode/utf8.c

    From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Wednesday, July 29, 2026 23:14:42
    https://gitlab.synchro.net/main/sbbs/-/commit/b1e66e262afaa7bc665a79b8
    Modified Files:
    src/encode/utf8.c
    Log Message:
    utf8: normalize EM DASH to a pair of ASCII hyphens

    utf8_normalize_str() folded U+2010 HYPHEN, U+2011 NON-BREAKING HYPHEN,
    U+2012 FIGURE DASH and U+2013 EN DASH to '-', but left U+2014 EM DASH
    alone. It fell through to unicode_to_cp437() instead and reached CP437 terminals as 0xC4, the box-drawing horizontal rule, which reads as a line rather than a dash in running prose - and is not ASCII at all for a
    US-ASCII terminal.

    Emit two hyphens, the conventional ASCII rendering of an em dash. The substitution consumes three bytes and writes two, so the in-place rewrite
    still never overtakes its source; HORIZONTAL ELLIPSIS, at three bytes to
    three characters, remains the tightest case in the function.

    U+2015 HORIZONTAL BAR is deliberately left alone: unicode_to_cp437()
    groups it with the box-drawing characters, for which CP437 0xC4 is an
    exact match rather than a fallback.

    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)