Skip to content

invalid character index in printf with unicode #23880

@JeffBezanson

Description

@JeffBezanson

I'm seeing this:

julia> @printf("%d×%d", 1, 2)
ERROR: LoadError: UnicodeError: invalid character index
Stacktrace:
 [1] getindex(::String, ::UnitRange{Int64}) at ./strings/string.jl:253
 [2] parse(::String) at ./printf.jl:45
 [3] gen(::String) at ./printf.jl:14
 [4] _printf(::String, ::Symbol, ::String, ::Tuple{Int64,Int64}) at ./printf.jl:1148
 [5] @printf(::LineNumberNode, ::Module, ::Vararg{Any,N} where N) at ./printf.jl:1218
in expression starting at REPL[1]:1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorregressionRegression in behavior compared to a previous versionstrings"Strings!"unicodeRelated to unicode characters and encodings

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions