diff --git a/chrome/content/zotero/xpcom/utilities.js b/chrome/content/zotero/xpcom/utilities.js index 7ad521767c..345ec9f1c2 100644 --- a/chrome/content/zotero/xpcom/utilities.js +++ b/chrome/content/zotero/xpcom/utilities.js @@ -1515,14 +1515,14 @@ Zotero.Utilities = { var val = string.charCodeAt(i); if(val >= 128) { if(val >= 2048) { - array[offset] = ((val >>> 6) | 192); - array[offset+1] = (val & 63) | 128; - offset += 2; - } else { array[offset] = (val >>> 12) | 224; array[offset+1] = ((val >>> 6) & 63) | 128; array[offset+2] = (val & 63) | 128; offset += 3; + } else { + array[offset] = ((val >>> 6) | 192); + array[offset+1] = (val & 63) | 128; + offset += 2; } } else { array[offset++] = val;