diff --git a/src/Compat.jl b/src/Compat.jl index 1069a23d2..b3cdb1498 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -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) @@ -1058,6 +1061,7 @@ module Unicode end else using Unicode + import Unicode: isassigned, normalize # not exported from Unicode module due to conflicts end end diff --git a/test/runtests.jl b/test/runtests.jl index f8f6d105f..c88320bc4 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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