Skip to content

Commit

Permalink
fix Unicode.julia_chartransform for Julia 1.10 (#52027)
Browse files Browse the repository at this point in the history
#49559 by @JeffBezanson updated `src/flisp/julia_charmap.h` but missed
[the
comment](https://github.com/JuliaLang/julia/blob/164969f3d06919b073f3aa9ee608e40974ca82d9/src/flisp/julia_charmap.h#L5-L6)
noting that `base/strings/unicode.jl` has to be updated accordingly.
  • Loading branch information
stevengj authored Nov 22, 2023
1 parent 85e3da0 commit 05f4b05
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions base/strings/unicode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ const _julia_charmap = Dict{UInt32,UInt32}(
0x00B7 => 0x22C5,
0x0387 => 0x22C5,
0x2212 => 0x002D,
0x210F => 0x0127,
)

utf8proc_map(s::AbstractString, flags::Integer, chartransform=identity) = utf8proc_map(String(s), flags, chartransform)
Expand Down
4 changes: 2 additions & 2 deletions stdlib/Unicode/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ using Unicode: normalize, isassigned, julia_chartransform
@test normalize("\u0072\u0307\u0323", :NFC) == "\u1E5B\u0307" #26917

# julia_chartransform identifier normalization
@test normalize("julia\u025B\u00B5\u00B7\u0387\u2212", chartransform=julia_chartransform) ==
"julia\u03B5\u03BC\u22C5\u22C5\u002D"
@test normalize("julia\u025B\u00B5\u00B7\u0387\u2212\u210F", chartransform=julia_chartransform) ==
"julia\u03B5\u03BC\u22C5\u22C5\u002D\u0127"
@test julia_chartransform('\u00B5') === '\u03BC'
end

Expand Down

0 comments on commit 05f4b05

Please sign in to comment.