Skip to content

Commit e2aa6f8

Browse files
authored
Use U+00C5 for encoding angstrom (#603)
1 parent dc044ee commit e2aa6f8

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/pkgdefaults.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -581,13 +581,12 @@ earth, a unit of acceleration, defined by standard to be exactly 9.806,65 m / s^
581581
\nSee Also: [`Unitful.yd`](@ref)."
582582
@unit mi "mi" Mile 1760yd false
583583
" Unitful.angstrom
584-
Unitful.
584+
Unitful.Å
585585
\nThe angstrom, a metric unit of length defined as 1/10 nm.
586586
\nDimension: [`Unitful.𝐋`](@ref).
587587
\nSee Also: [`Unitful.nm`](@ref)."
588-
@unit angstrom "" Angstrom (1//10)*nm false
589-
# U+00c5 (opt-shift-A on macOS) and U+212b ('\Angstrom' in REPL) look identical:
590-
@doc @doc(angstrom) const Å == angstrom
588+
@unit angstrom "Å" Angstrom (1//10)*nm false
589+
@doc @doc(angstrom) const Å = angstrom
591590

592591
# Area
593592
" Unitful.ac

test/runtests.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1993,6 +1993,11 @@ end
19931993
@test u"ɛ0" === u"ε0"
19941994
@test uparse("ɛ0") === uparse("ε0")
19951995
@test @doc(Unitful.ɛ0) == @doc(Unitful.ε0)
1996+
# Julia treats Å (U+00C5) and Å (U+212B) as the same
1997+
@test Unitful.Å === Unitful.=== Unitful.angstrom
1998+
@test u"Å" === u""
1999+
@test uparse("Å") === uparse("")
2000+
@test @doc(Unitful.Å) == @doc(Unitful.Å)
19962001
end
19972002

19982003
module DocUnits

0 commit comments

Comments
 (0)