Add Unicode normalization utility function, using NFC
Addresses https://www.zotero.org/trac/ticket/865 Need to decide the best place to call this
This commit is contained in:
parent
ab9545688f
commit
6ec69b0b91
1 changed files with 12 additions and 0 deletions
|
@ -105,6 +105,18 @@ Zotero.Utilities.Internal = {
|
|||
},
|
||||
|
||||
|
||||
/**
|
||||
* Unicode normalization
|
||||
*/
|
||||
"normalize":function(str) {
|
||||
var normalizer = Components.classes["@mozilla.org/intl/unicodenormalizer;1"]
|
||||
.getService(Components.interfaces.nsIUnicodeNormalizer);
|
||||
var obj = {};
|
||||
str = normalizer.NormalizeUnicodeNFC(str, obj);
|
||||
return obj.value;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Display a prompt from an error with custom buttons and a callback
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue