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:
Dan Stillman 2011-12-17 18:09:51 -05:00
parent ab9545688f
commit 6ec69b0b91

View file

@ -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
*/