'Send grid api sends the attachment with different encoding

I have an issue where we are using ASP.NET framework and SendGrid api/sdk to send the email to users. We have the attachment name in Spanish character as shown below but when the mail is received it encodes differently in outlook. In Gmail, the Spanish characters are shown correctly, but this issue is with Outlook.

I have tried different ways like normalizing string and converting into base64 but that approach doesn't work. It is only happening with email attachments but not with email body. I came to know SendGrid by default converts for Ascii to UTF-8 encoding. Refer the code below.

enter image description here

enter image description here

This issue is more prevalent in outlook, can someone share the solution.

enter image description here



Solution 1:[1]

It looks like you are using UTF32 to encode the file name and send it to SendGrid. I would recommend you try UTF8.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 philnash