String normalize()
The normalize() method of String values returns the Unicode Normalization Form of this string.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
| 34 | 12 | 31 | 10 | 34 | 10 | |
1+Supported (version) Not supported ※Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)
Syntax
JAVASCRIPT
// 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..
PreviewFullscreen
full-width / half-width. consistent (NFKC)
full-width. numbercharacter half-width to, symbol standard shape notation to positiveization..
PreviewFullscreen
Search time. notation
differentizationshape notation. Character in also, positiveization and in positivematchng in..
PreviewFullscreen
Use cases
-
Using String normalize()
The normalize() method of String values returns the Unicode Normalization
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.