encodeURI for filenames with characters, that not allowed in headers

I've got an error if I try to upload a filename with russian file name.