commit 6ec69b0b911569016dad25153565d61ca8894821 parent ab9545688f78e375c56913c584e50ea271eabf0d Author: Dan Stillman <dstillman@zotero.org> Date: Sat, 17 Dec 2011 18:09:51 -0500 Add Unicode normalization utility function, using NFC Addresses https://www.zotero.org/trac/ticket/865 Need to decide the best place to call this Diffstat:
| M | chrome/content/zotero/xpcom/utilities_internal.js | | | 12 | ++++++++++++ |
1 file changed, 12 insertions(+), 0 deletions(-)
diff --git a/chrome/content/zotero/xpcom/utilities_internal.js b/chrome/content/zotero/xpcom/utilities_internal.js @@ -106,6 +106,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 */ "errorPrompt":function(title, e) {