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

Rename Unicode package to Strings. #25416

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion base/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ characters from that character until the start of the next line are ignored.
julia> buf = IOBuffer(" text")
IOBuffer(data=UInt8[...], readable=true, writable=false, seekable=true, append=false, size=8, maxsize=Inf, ptr=1, mark=-1)

julia> using Unicode
julia> using Strings

julia> skipchars(buf, isspace)
IOBuffer(data=UInt8[...], readable=true, writable=false, seekable=true, append=false, size=8, maxsize=Inf, ptr=5, mark=-1)
Expand Down
2 changes: 1 addition & 1 deletion base/operators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ entered in the Julia REPL (and most editors, appropriately configured) by typing

# Examples
```jldoctest
julia> using Unicode
julia> using Strings

julia> map(uppercase∘hex, 250:255)
6-element Array{String,1}:
Expand Down
2 changes: 1 addition & 1 deletion base/strings/substring.jl
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ julia> reverse("JuliaLang")
julia> reverse("ax̂e") # combining characters can lead to surprising results
"êxa"

julia> using Unicode
julia> using Strings

julia> join(reverse(collect(graphemes("ax̂e")))) # reverses graphemes
"ex̂a"
Expand Down
36 changes: 18 additions & 18 deletions base/strings/unicode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ For example, NFKC corresponds to the options `compose=true, compat=true, stable=

# Examples
```jldoctest
julia> using Unicode
julia> using Strings

julia> "μ" == normalize("µ", compat=true) #LHS: Unicode U+03bc, RHS: Unicode U+00b5
true
Expand Down Expand Up @@ -259,7 +259,7 @@ Give the number of columns needed to print a character.

# Examples
```jldoctest
julia> using Unicode
julia> using Strings

julia> textwidth('α')
1
Expand All @@ -280,7 +280,7 @@ Give the number of columns needed to print a string.

# Examples
```jldoctest
julia> using Unicode
julia> using Strings

julia> textwidth("March")
5
Expand Down Expand Up @@ -320,7 +320,7 @@ Returns `true` if the given char or integer is an assigned Unicode code point.

# Examples
```jldoctest
julia> using Unicode
julia> using Strings

julia> isassigned(101)
true
Expand All @@ -342,7 +342,7 @@ Letter: Lowercase.

# Examples
```jldoctest
julia> using Unicode
julia> using Strings

julia> islower('α')
true
Expand All @@ -367,7 +367,7 @@ Letter: Uppercase, or Lt, Letter: Titlecase.

# Examples
```jldoctest
julia> using Unicode
julia> using Strings

julia> isupper('γ')
false
Expand All @@ -391,7 +391,7 @@ Tests whether a character is a decimal digit (0-9).

# Examples
```jldoctest
julia> using Unicode
julia> using Strings

julia> isdigit('❤')
false
Expand All @@ -414,7 +414,7 @@ category Letter, i.e. a character whose category code begins with 'L'.

# Examples
```jldoctest
julia> using Unicode
julia> using Strings

julia> isalpha('❤')
false
Expand All @@ -440,7 +440,7 @@ Use [`isdigit`](@ref) to check whether a character a decimal digit between 0 and

# Examples
```jldoctest
julia> using Unicode
julia> using Strings

julia> isnumeric('௰')
true
Expand All @@ -466,7 +466,7 @@ category Letter or Number, i.e. a character whose category code begins with 'L'

# Examples
```jldoctest
julia> using Unicode
julia> using Strings

julia> isalnum('❤')
false
Expand Down Expand Up @@ -494,7 +494,7 @@ Control characters are the non-printing characters of the Latin-1 subset of Unic

# Examples
```jldoctest
julia> using Unicode
julia> using Strings

julia> iscntrl('\\x01')
true
Expand All @@ -513,7 +513,7 @@ character whose category code begins with 'P'.

# Examples
```jldoctest
julia> using Unicode
julia> using Strings

julia> ispunct('α')
false
Expand All @@ -538,7 +538,7 @@ category Zs.

# Examples
```jldoctest
julia> using Unicode
julia> using Strings

julia> isspace('\\n')
true
Expand All @@ -564,7 +564,7 @@ Tests whether a character is printable, including spaces, but not a control char

# Examples
```jldoctest
julia> using Unicode
julia> using Strings

julia> isprint('\\x01')
false
Expand All @@ -586,7 +586,7 @@ classified with `isgraph(c)==true`.

# Examples
```jldoctest
julia> using Unicode
julia> using Strings

julia> isgraph('\\x01')
false
Expand All @@ -605,7 +605,7 @@ include `x` (as in the standard `0x` prefix).

# Examples
```jldoctest
julia> using Unicode
julia> using Strings

julia> isxdigit('a')
true
Expand All @@ -625,7 +625,7 @@ Return `s` with all characters converted to uppercase.

# Examples
```jldoctest
julia> using Unicode
julia> using Strings

julia> uppercase("Julia")
"JULIA"
Expand All @@ -640,7 +640,7 @@ Return `s` with all characters converted to lowercase.

# Examples
```jldoctest
julia> using Unicode
julia> using Strings

julia> lowercase("STRINGS AND THINGS")
"strings and things"
Expand Down
2 changes: 1 addition & 1 deletion base/sysimg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ Base.require(:Profile)
Base.require(:SharedArrays)
Base.require(:SuiteSparse)
Base.require(:Test)
Base.require(:Unicode)
Base.require(:Strings)
Base.require(:Distributed)
Base.require(:Printf)
Base.require(:Future)
Expand Down
2 changes: 1 addition & 1 deletion stdlib/Printf/src/Printf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export @printf, @sprintf
using Base.Printf: _printf, is_str_expr, fix_dec, DIGITS, print_fixed, decode_dec, decode_hex,
ini_hex, ini_HEX, print_exp_a, decode_0ct, decode_HEX, ini_dec, print_exp_e,
decode_oct, _limit
using Unicode.textwidth
using Strings.textwidth

"""
@printf([io::IOStream], "%Fmt", args...)
Expand Down
25 changes: 25 additions & 0 deletions stdlib/Strings/docs/src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Strings

```@docs
Strings.isassigned
Strings.normalize
Strings.graphemes
Strings.uppercase
Strings.lowercase
Strings.titlecase
Strings.ucfirst
Strings.lcfirst
Strings.textwidth
Strings.isalnum
Strings.isalpha
Strings.iscntrl
Strings.isdigit
Strings.isgraph
Strings.islower
Strings.isnumeric
Strings.isprint
Strings.ispunct
Strings.isspace
Strings.isupper
Strings.isxdigit
```
10 changes: 5 additions & 5 deletions stdlib/Unicode/src/Unicode.jl → stdlib/Strings/src/Strings.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__precompile__(true)

module Unicode
module Strings

using Base.Unicode: normalize, graphemes, isassigned, textwidth, isvalid,
islower, isupper, isalpha, isdigit, isxdigit, isnumeric, isalnum,
Expand All @@ -16,10 +16,10 @@ export graphemes, textwidth, isvalid,

# BEGIN 0.7 deprecations

@deprecate isnumber(c::Char) Unicode.isnumeric(c)
@deprecate is_assigned_char(c::Char) Unicode.isassigned(c)
@deprecate normalize_string(s::AbstractString, nf::Symbol; kwargs...) Unicode.normalize(s, nf; kwargs...)
@deprecate normalize_string(s::AbstractString; kwargs...) Unicode.normalize(s; kwargs...)
@deprecate isnumber(c::Char) Strings.isnumeric(c)
@deprecate is_assigned_char(c::Char) Strings.isassigned(c)
@deprecate normalize_string(s::AbstractString, nf::Symbol; kwargs...) Strings.normalize(s, nf; kwargs...)
@deprecate normalize_string(s::AbstractString; kwargs...) Strings.normalize(s; kwargs...)

# END 0.7 deprecations

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# This file is a part of Julia. License is MIT: https://julialang.org/license

using Test
using Unicode
using Unicode: normalize, isassigned
using Strings
using Strings: normalize, isassigned

@testset "string normalization" begin
# normalize (Unicode normalization etc.):
Expand Down
25 changes: 0 additions & 25 deletions stdlib/Unicode/docs/src/index.md

This file was deleted.

2 changes: 1 addition & 1 deletion test/compile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ try
Dict(s => Base.module_uuid(Base.root_module(s)) for s in
[:Base64, :CRC32c, :Dates, :DelimitedFiles, :FileWatching, :Future,
:IterativeEigensolvers, :Logging, :Mmap, :Printf, :Profile, :SharedArrays,
:SuiteSparse, :Test, :Unicode, :Distributed]))
:SuiteSparse, :Test, :Strings, :Distributed]))
@test discard_module.(deps) == deps1

@test current_task()(0x01, 0x4000, 0x30031234) == 2
Expand Down