Skip to content

Feature request: Unicode normalization #1289

@noinkling

Description

@noinkling

When dealing with strings that may have characters outside the ASCII range, String.prototype.normalize() often becomes an essential part of the processing/validation pipeline.

For this reason it would be nice to have a .normalize() validator/converter on strings, akin to .trim()/.uppercase()/.lowercase(). It would optionally accept a normalization form just like the original method, defaulting to NFC otherwise.

I wasn't going to open an issue until I had a PR ready, but I don't know how long that will take, so I thought I'd drop the request here in the meantime just in case someone else feels like having a go.

For tests the smartest thing to do is probably to have a string where the source and all 4 normalization forms are different from each other.

Metadata

Metadata

Assignees

Labels

featureNew functionality or improvement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions