Normalize Unicode in new filenames

This commit is contained in:
Dan Stillman 2016-03-23 03:23:13 -04:00
parent 002dd66e03
commit 0d343458a3

View file

@ -779,6 +779,9 @@ Zotero.File = new function(){
if (!skipXML) { if (!skipXML) {
// Strip characters not valid in XML, since they won't sync and they're probably unwanted // Strip characters not valid in XML, since they won't sync and they're probably unwanted
fileName = fileName.replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f\ud800-\udfff\ufffe\uffff]/g, ''); fileName = fileName.replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f\ud800-\udfff\ufffe\uffff]/g, '');
// Normalize to NFC
fileName = fileName.normalize();
} }
// Don't allow hidden files // Don't allow hidden files
fileName = fileName.replace(/^\./, ''); fileName = fileName.replace(/^\./, '');