diff --git a/chrome/content/zotero/xpcom/utilities_internal.js b/chrome/content/zotero/xpcom/utilities_internal.js index 7d6a726f25..fdab0c5c3e 100644 --- a/chrome/content/zotero/xpcom/utilities_internal.js +++ b/chrome/content/zotero/xpcom/utilities_internal.js @@ -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 */