• dd_lightbar_menu: str_is_utf8() seems to return true sometimes when a

    From Rob Swindell@VERT to GitLab note in main/sbbs on Thursday, June 27, 2024 13:46:20
    https://gitlab.synchro.net/main/sbbs/-/merge_requests/440#note_5382

    All ASCII characters (and thus, ASCII strings) are also valid UTF-8 characters/strings.

    So... I'm not clear on what you mean by "sometimes"? If there's, say, a CP437 character in a string, then *that* string would not be a valid UTF-8 string, but all purely ASCII strings are valid UTF-8 strings.

    The JSDOC for this function says "Return true if the specified string contains only valid UTF-8 encoded and US-ASCII characters" - so I'm not clear if/how this function isn't behaving as expected or you just didn't read the "US-ASCII" part?

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Eric Oulashin@VERT to GitLab note in main/sbbs on Thursday, June 27, 2024 14:34:48
    https://gitlab.synchro.net/main/sbbs/-/merge_requests/440#note_5383

    I haven't thoroughly tested it, so I don't know if it happens in all cases, which is why I said "sometimes". I understand that str_is_utf8() is meant to return true if the string contains only valid UTF-8 encoded and ASCII characters.

    The issue I'm seeing is with some of my mods - For instance, with my area choosers, they're taking the message group, sub-board, file libraries, and directory names from the BBS's configuration, and it's using those in lightbar menu items. I'm not using any UTF-8 characters in my area choosers, and for the group/sub-board/library/directory names, I had the impression that those don't have UTF-8 characters, but str_is_utf8() is returning true for the text strings in the menu item, and that's causing some display issues in my area chooser mods.

    Basically, this change reverts back to previous behavior which did not use str_is_utf8(), and that is enabling my other mods to work as expected for now.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to GitLab note in main/sbbs on Thursday, June 27, 2024 14:42:13
    https://gitlab.synchro.net/main/sbbs/-/merge_requests/440#note_5384

    I would expect `str_is_utf8()` to return true for most group/sub-board/library/directory names.

    Most strings configured in in SCFG contain just US-ASCII characters, which makes them *also* valid UTF-8 strings.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to GitLab note in main/sbbs on Thursday, June 27, 2024 14:43:26
    https://gitlab.synchro.net/main/sbbs/-/merge_requests/440#note_5385

    I had the impression that those don't have UTF-8 characters

    ASCII characters *are* UTF-8 characters.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net