Fix #1850: Cannot upload attachments if the filename contains only non-Latin characters