String normalize()
The normalize() method of strings returns a Unicode normal form of a string as a new string. More than one code point sequence can represent the same characters. You can use the normalize() method to find canonically or compatibly equivalent strings.
Overview
The normalize() method of strings returns a Unicode normal form of a string as a new string. More than one code point sequence can represent the same characters. You can use the normalize() method to find canonically or compatibly equivalent strings.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
| 34 | 12 | 31 | 10 | 34 | 10 | |
Syntax
// Unify the two representations of 'ga'
const a = '\u304C'; // ga (single character)
const b = '\u304B\u3099'; // ka + dakuten
a === b; // false
a.normalize() === b.normalize(); // true Live demo
dotcharacter. positiveizationcomparison
" that " 1character in table or " or +dot" in table or positiveization in keep consistentcomparison..
full-width / half-width. consistent (NFKC)
full-width. numbercharacter half-width to, symbol standard shape notation to positiveization..
Search time. notation
differentizationshape notation. Character in also, positiveization and in positivematchng in..
Use cases
Using String normalize()
The normalize() method of strings returns a Unicode normal form of a string as a new string. More than one code point sequence can represent the same characters. You can use the normalize() method to find canonically or compatibly equivalent strings.
Cautions
- No specific concerns. Stable across all major browsers.
Accessibility
- When updating the DOM dynamically, announce important changes to assistive technology with aria-live regions.
Related links
Powered by web-features