Skip to content

feat: add NFKC normalization to autocomplete#1267

Open
Asraye wants to merge 1 commit into
stoatchat:mainfrom
Asraye:feat/NFKC-autocomplete
Open

feat: add NFKC normalization to autocomplete#1267
Asraye wants to merge 1 commit into
stoatchat:mainfrom
Asraye:feat/NFKC-autocomplete

Conversation

@Asraye

@Asraye Asraye commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Adds NFKC normalization to autocomplete, so things such as "𝑨𝒔𝒓𝒂𝒚𝒆" will show up in user mentions, or "𝑪𝒉𝒆𝒆𝒔𝒆" in channel/role mentions.

We only have to normalize the label, we keep display label as the formatted text as It gives a better user-feedback.

What Is NFKC?

Thought I'd add this section, as a lot of people don't know the beautiful thing of NFKC!

NFKC stands for "Normalization Form Compatibility Composition". It's an unicode normalization form that converts text into a standardized representation by applying compatibility mappings and then recomposing characters where possible :P

This is good as it means that many accented or otherwise stylized unicode characters are converted into more standard equivalents, for example: 𝑪𝒉𝒆𝒆𝒔𝒆 becomes Cheese and becomes 1

We can use NFKC here as it helps autocomplete work more consistently with accented or stylized text. Compared to NFC (Normalization Form Canonical Composition), NFKC is more aggressive and normalizes a wider range of visually similar characters, which is better suited for this usage.

How was this PR tested?

Tested locally with all autocompletes.

Screenshots & Screencasts (if appropriate)

image image image

Checklist:

  • I have carefully read the contributing guidelines
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if applicable
  • I have no unrelated changes in the PR
  • I have confirmed that any new dependencies are strictly necessary
  • I have written tests for new code (if applicable)
  • I have followed naming conventions/patterns in the surrounding code

Please declare, if any, LLM usage involved in creating this PR

None
...

Signed-off-by: AsrayeDev <asrayeofficial@gmail.com>
@Asraye Asraye requested review from a team as code owners June 9, 2026 09:49
@Dadadah Dadadah requested a review from Pecacheu June 9, 2026 15:35

@Pecacheu Pecacheu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working for me! Glad someone knows what this NFKC thing even is cause I had no idea it had an acronym I just call it "fancy emoji letters" lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants