Skip to content

Utf8: count and countInString unexpected behavior #266

@ospencer

Description

@ospencer

My understanding of these two functions is that they return the number of Unicode scalars in a string, such that List.length(decodeUcharInString(s)) == countInString(s) should always be true (but let me know if that isn't the intended behavior of countInString).

countInString("✨") returns a value of 3, but I expected it to return 1. That seems to be the case for most 3-byte utf8 characters, while 1-, 2-, and 4-byte characters return 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions