Fix stringToUTF8Array
This commit is contained in:
parent
1585ece566
commit
a926259d31
1 changed files with 4 additions and 4 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue