• Re: A nice "strlen()" for UTF-8 ...

    From Michael S@3:633/10 to All on Mon Nov 24 19:51:47 2025
    On Mon, 24 Nov 2025 18:32:13 +0100
    David Brown <david.brown@hesbynett.no> wrote:

    On 24/11/2025 18:16, Michael S wrote:
    On Mon, 24 Nov 2025 15:45:42 +0100
    David Brown <david.brown@hesbynett.no> wrote:

    On 24/11/2025 14:31, Bonita Montero wrote:
    I don't understand your problem. You seem extremely obsessive. A
    character can be anything,
    a Unicode code point or an ASCII character. The latter aren't
    really characters in the literal
    sense either, but that's what they're called.

    That's /your/ definition.

    Use your own private definition if you want, but don't deride other
    people for using correct definitions appropriate to the context.
    You made a function for counting Unicode code points from a UTF8
    string. That's great - it's a useful thing to do. Just call it
    that instead of picking an inaccurate name for it. What is your
    difficulty in using the simple, clear and correct term "code
    point" instead of a vague and poorly defined alternative?


    Do you happen to know what is represented by values of type 'char'
    in Rust? :-)


    No, sorry.


    I thought that you can guess that it represents Unicode code point.
    Of course, "The Book" pays lip servers: "However, a ?character?
    ?? isn?t
    really a concept in Unicode, so your human intuition for what a
    ?character? is may not match up with what a char is in Rust
    ."
    But who pays attention to lip service?
    You can be reasonably sure that 99.99% of Rust programmers use the word 'character' in the meaning 'Unicode code point'.






    --- PyGate Linux v1.5.1
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Michael S@3:633/10 to All on Mon Nov 24 19:54:55 2025
    On Mon, 24 Nov 2025 15:45:42 +0100
    David Brown <david.brown@hesbynett.no> wrote:

    it's a useful thing to do.

    Is it?




    --- PyGate Linux v1.5.1
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From David Brown@3:633/10 to All on Mon Nov 24 21:14:30 2025
    On 24/11/2025 18:54, Michael S wrote:
    On Mon, 24 Nov 2025 15:45:42 +0100
    David Brown <david.brown@hesbynett.no> wrote:

    it's a useful thing to do.

    Is it?


    I don't think it is a /very/ useful thing, compared to things like
    finding the length of the UTF-8 string in bytes, or the space needed to display the string. But I'm fairly sure people do use such functions.


    --- PyGate Linux v1.5.1
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)