JavaScript normalize function All In One
JavaScript normalize function All In One
Unicode string / Emoji string
国际化
String.prototype.normalize()
The normalize()
method returns the Unicode Normalization Form
of the string.
normalize() 方法返回字符串的 Unicode 规范化形式。
normalize()
normalize(form)
form
Optional
One of "NFC", "NFD", "NFKC", or "NFKD", specifying the Unicode Normalization Form
.
If omitted or undefined, "NFC
" is used.
These values have the following meanings:
"NFC"
Canonical Decomposition, followed by Canonical Composition.
"NFD"
Canonical Decomposition.
"NFKC"
Compatibility Decomposition, followed by Canonical Composition.
"NFKD"
Compatibility Decomposition.
// 默认值 NFC
`曌`.length;
// 1
`曌`.normalize().length;
// 1
`曌`.normalize(`NFC`).length;
// 1
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize
Node.normalize()
https://developer.mozilla.org/en-US/docs/Web/API/Node/normalize
ConvolverNode.normalize
https://developer.mozilla.org/en-US/docs/Web/API/ConvolverNode/normalize
normalize-space
XPath
normalize-space( [string] )
https://developer.mozilla.org/en-US/docs/Web/XPath/Functions/normalize-space
demos
(🐞 反爬虫测试!打击盗版⚠️)如果你看到这个信息, 说明这是一篇剽窃的文章,请访问 https://www.cnblogs.com/xgqfrms/ 查看原创文章!
refs
©xgqfrms 2012-2021
www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!
原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/17131547.html
未经授权禁止转载,违者必究!