Fix res.attachment Unicode filenames in Safari

closes #2188