Normalize Unicode in new filenames
This commit is contained in:
parent
002dd66e03
commit
0d343458a3
1 changed files with 3 additions and 0 deletions
|
@ -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(/^\./, '');
|
||||||
|
|
Loading…
Reference in a new issue