Skip to content

docs: Idna.domainToUnicode KDoc says NFC is (deferred) but the function actually performs NFC normalization #96

Description

@OmarAlJarrah

Problem

The KDoc on domainToUnicode (kuri/src/commonMain/kotlin/org/dexpace/kuri/idna/Idna.kt:148) describes the pipeline as "map, (deferred) NFC, then Punycode-decode." Elsewhere in the same file, "(deferred)" consistently means "not implemented yet."

Three lines below the stale comment, the function actually calls splitLabels(Normalizer.nfc(mapped)) (lines 154-155) — NFC normalization is genuinely performed, and both the inline comment at that call site and the class-level KDoc (lines 47-48) correctly describe NFC as fully implemented. git blame confirms the "(deferred) NFC" text predates the later commit that added the Normalizer.nfc call and was never updated afterward.

Impact

A maintainer reading only the function-level KDoc concludes the ToUnicode/display path skips NFC and could refactor on that false premise — for example adding a redundant NFC pass before calling domainToUnicode, or assuming Idn.toUnicode returns non-normalized text when it in fact returns NFC-normalized output.

Suggested fix

Remove "(deferred)" from the domainToUnicode KDoc so it matches the class-level KDoc and the actual implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions