Skip to content

SubString{UTF8String} and UTF8String have different slicing behaviour #7811

@ivarne

Description

@ivarne

Found this on stackoverflow

julia> a = "æøå"
"æøå"

julia> a[2:end]
"øå"

julia> b = SubString(a,1)
"æøå"

julia> b[2:end]
ERROR: invalid SubString indexes
 in getindex at ./string.jl:657

I'm not sure what the correct behaviour should be, but having them different seems wrong. Some relevant discussion in #5446

Metadata

Metadata

Assignees

No one assigned

    Labels

    breakingThis change will break codebugIndicates an unexpected problem or unintended behaviorneeds decisionA decision on this change is needed

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions