Skip to content

Commit 7c3bbc2

Browse files
committed
Uppercase fixes
1 parent 6dea360 commit 7c3bbc2

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ keywords = ["Characters"]
44
license = "MIT"
55
desc = "Basic functionality for Chr type"
66
authors = ["ScottPJones <scottjones@alum.mit.edu>"]
7-
version = "0.1.7"
7+
version = "0.1.8"
88

99
[deps]
1010
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"

REQUIRE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
julia 0.6 2-
22
ModuleInterfaceTools 0.1.6
3-
StrAPI 0.1.7
3+
StrAPI 0.1.8
44
CharSetEncodings 0.1.8

src/casefold.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ uppercase(ch::ASCIIChr) = _islower_a(ch) ? ASCIIChr(ch - 0x20) : ch
2525
titlecase(ch::ASCIIChr) = uppercase(ch)
2626

2727
lowercase(ch::T) where {T<:LatinChars} = T(_lowercase_l(codepoint(ch)))
28-
uppercase(ch::LatinChr) = LatinChr(_uppercase_l(codepoint(ch)))
28+
29+
_uppercase_latin(ch) = _can_upper(ch) ? ch - 0x20 : ch
30+
uppercase(ch::LatinChr) = LatinChr(_uppercase_latin(codepoint(ch)))
2931

3032
# Special handling for case where this is just an optimization of the first 256 bytes of Unicode,
3133
# and not the 8-bit ISO 8859-1 character set

0 commit comments

Comments
 (0)