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

add Unicode.isassigned and Unicode.normalize to Compat.Unicode #507

Merged
merged 2 commits into from
Mar 1, 2018
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
4 changes: 4 additions & 0 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,9 @@ module Unicode
end

isnumeric(c::Char) = isnumber(c)
isassigned(c) = is_assigned_char(c)
normalize(s::AbstractString; kws...) = normalize_string(s; kws...)
normalize(s::AbstractString, nf::Symbol) = normalize_string(s, nf)

# 0.6.0-dev.1404 (https://github.com/JuliaLang/julia/pull/19469)
if !isdefined(Base, :titlecase)
Expand All @@ -1058,6 +1061,7 @@ module Unicode
end
else
using Unicode
import Unicode: isassigned, normalize # not exported from Unicode module due to conflicts
end
end

Expand Down
3 changes: 3 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1049,6 +1049,9 @@ module Test25021
@test !isnumeric('a')
@test isnumeric('1')
@test titlecase("firstname lastname") == "Firstname Lastname"
@test Compat.Unicode.isassigned('柒') && !Compat.Unicode.isassigned(0xfffe)
@test Compat.Unicode.normalize("\U1e9b\U0323", :NFKC) == "\U1e69"
@test Compat.Unicode.normalize("\t\r", stripcc=true) == " "
end

# 0.7.0-DEV.2951
Expand Down