From 207af37ee7ce4bafe40c63128b1ec53441a7a0e4 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 26 Aug 2011 20:45:27 +0000 Subject: [PATCH] Don't strip extended characters in duplicate detection --- chrome/content/zotero/xpcom/duplicates.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/duplicates.js b/chrome/content/zotero/xpcom/duplicates.js index 734f8b0d03..6dbf2d3b36 100644 --- a/chrome/content/zotero/xpcom/duplicates.js +++ b/chrome/content/zotero/xpcom/duplicates.js @@ -111,7 +111,7 @@ Zotero.Duplicates.prototype._findDuplicates = function () { str = str + ""; str = Zotero.Utilities.removeDiacritics(str) - .replace(/[^!-~]/g, ' ') // Convert punctuation to spaces + .replace(/[!-/:-@[-`{-~]/g, ' ') // Convert (ASCII) punctuation to spaces .replace(/ +/, ' ') // Normalize spaces .toLowerCase(); @@ -173,6 +173,7 @@ Zotero.Duplicates.prototype._findDuplicates = function () { processRows(function (a, b) { a = normalizeString(a.value); b = normalizeString(b.value); + // If we stripped one of the strings completely, we can't compare them if (a.length == 0 || b.length == 0) { return -1;