Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Unicode.julia_chartransform for Julia 1.10 #52027

Merged
merged 2 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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