Skip to content

Wrong number of characters in broken UTF-8 string #6255

Description

@dearblue

mruby built with MRB_UTF8_STRING enabled does not count characters in the 0x80...0xc0 in broken strings.

Here is the result when built with build_config/host-debug.rb:

p "\x80\x81\x82\x83".size
# => 0 (acctual; currently master 7edbff8c83cd19749da576aca945fcbf64602bd5, mruby-3.3.0, mruby-3.2.0)
# => 4 (expected; mruby-3.1.0, CRuby)

I checked with git bisect and it reported commit 916fd64.
But now it has been replaced by the SWAR technique, so a simple revert is not possible.

I don't know how to fix it, so I'll just report it.

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