From 0e30de83c159f8071002ac24006be12f63d2dd7f Mon Sep 17 00:00:00 2001 From: Priynsh <119518987+Priynsh@users.noreply.github.com> Date: Sun, 1 Dec 2024 19:00:31 +0530 Subject: [PATCH 1/3] Update unicode.jl edited documentation to point out the difference from a same named method in c (ispunct) --- base/strings/unicode.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base/strings/unicode.jl b/base/strings/unicode.jl index ad047514c85a6..0d9a9cdee933b 100644 --- a/base/strings/unicode.jl +++ b/base/strings/unicode.jl @@ -532,8 +532,8 @@ iscntrl(c::AbstractChar) = c <= '\x1f' || '\x7f' <= c <= '\u9f' ispunct(c::AbstractChar) -> Bool Tests whether a character belongs to the Unicode general category Punctuation, i.e. a -character whose category code begins with 'P'. - +character whose category code begins with 'P'.\n +*Note*: This behavior is different from the ispunct function in C which checks for printable characters that are not alphanumeric or whitespace, based on the ASCII. # Examples ```jldoctest julia> ispunct('α') From 45303aac132d98424e1af22e6551f04c58c0285e Mon Sep 17 00:00:00 2001 From: Priynsh <119518987+Priynsh@users.noreply.github.com> Date: Sun, 1 Dec 2024 21:06:30 +0530 Subject: [PATCH 2/3] Update unicode.jl implemented changes suggested :) --- base/strings/unicode.jl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/base/strings/unicode.jl b/base/strings/unicode.jl index 0d9a9cdee933b..d4cfb4a9fe0ac 100644 --- a/base/strings/unicode.jl +++ b/base/strings/unicode.jl @@ -532,13 +532,18 @@ iscntrl(c::AbstractChar) = c <= '\x1f' || '\x7f' <= c <= '\u9f' ispunct(c::AbstractChar) -> Bool Tests whether a character belongs to the Unicode general category Punctuation, i.e. a -character whose category code begins with 'P'.\n -*Note*: This behavior is different from the ispunct function in C which checks for printable characters that are not alphanumeric or whitespace, based on the ASCII. +character whose category code begins with 'P'. + +!!! note + This behavior is different from the `ispunct` function in C. # Examples ```jldoctest julia> ispunct('α') false +julia> ispunct('=') +false + julia> ispunct('/') true From e728ee77d582901a79338dce9ee9269a96563ec3 Mon Sep 17 00:00:00 2001 From: Priynsh <119518987+Priynsh@users.noreply.github.com> Date: Sun, 1 Dec 2024 21:25:55 +0530 Subject: [PATCH 3/3] Update base/strings/unicode.jl Co-authored-by: Lilith Orion Hafner --- base/strings/unicode.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/base/strings/unicode.jl b/base/strings/unicode.jl index d4cfb4a9fe0ac..fcb4a371e9898 100644 --- a/base/strings/unicode.jl +++ b/base/strings/unicode.jl @@ -536,6 +536,7 @@ character whose category code begins with 'P'. !!! note This behavior is different from the `ispunct` function in C. + # Examples ```jldoctest julia> ispunct('α')