Fixes Issue #1850 (cannot upload attachments if the filename contains non-Latin characters)