typelevel / typelevel/case-insensitive

Unicode Case Folding

Open
#228 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Scala
Stars
38
Forks
15
Avg merge
5d 5h
Merged PRs (30d)
3

Description

While working on cats-uri, I ran into an issue with how CIString was handling certain unicode values which led me to notice it wasn't respecting Caseless matching from the Unicode standard. As it turns out, neither does String.equalsIgnoreCase.

I'd just about completed a branch to implement full case folding as defined by the Unicode standard when I ran across this test.

  test("character based equality") {
    assert(CIString("ß") != CIString("SS"))
  }

Since under the Unicode standard's caseless matching these two strings would compare equal, I'm beginning to think we are intentionally not following the standard here. Is that the case? If so, why? Is it to maintain parity with what the Java standard library is doing with methods like equalsIgnoresCase?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with tests/shared/src/test/scala/org/typelevel/ci/CIStringSuite.scala, especially the character-based equality test, and read the linked Unicode caseless-matching section. Compare the existing behavior with the full-unicode-case-folding branch mentioned in the issue. Done means the project’s intended case-folding semantics are decided and the relevant tests and implementation consistently reflect that decision.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
internationalization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.