Julia Language Diacritic-Insensitive String Comparison


Example

Sometimes, one wants strings like "resume" and "résumé" to compare equal. That is, graphemes that share a basic glyph, but possibly differ because of additions to those basic glyphs. Such comparison can be accomplished by stripping diacritical marks.

equals_ignore_mark(s, t) =
    normalize_string(s, stripmark=true) == normalize_string(t, stripmark=true)

This allows the above example to work correctly. Additionally, it works well even with non-ASCII Unicode characters.

julia> equals_ignore_mark("resume", "résumé")
true

julia> equals_ignore_mark("αβγ", "ὰβ̂γ̆")
true