You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Attachment Name does not show Norwegian Characters #19
I am new to SendGrid, I wanted to send a mail with attachment having Norwegian characters in the name. Receiver is receiving the mail but the name contains Å instead of Ø. Saw the Client class , it contains the change for UTF characters
sendgrid-java v3.1.0 is being used. Not using the java-http-client. I visited few related issues but was not able to get which api version include this change. Its urgent for me as we are going in production in two weeks.
Hei @thinkingserious
I am not able to get why its converting Ø -->Å , because the Client.java class has the UTF-8 support then why I am facing the issue.. ? Is this because of the dependency thats not included in sendgrid-java v3.1.0 ,I can externally include the dependency of httpClient if its required. But will it help. ? I need a urgent fix as we are moving in production in few days.
Hey @thinkingserious
I hardcoded the value in the attachment name, then also I was facing the same error. You are using the same version of sendgrid-java. ?
I have received the email correctly in GMail. Since the filename is correct on your server and in GMail, it appears the issue is with Outlook and that it might be a known problem.
I'm going to leave this issue open for further investigation. Perhaps there is some header that Microsoft Outlook requires to ensure UTF-0 encoding.
Since there has been no activity on this issue since March 1, 2020, we are closing this issue. Please feel free to reopen or create a new issue if you still require assistance. Thank you!
Activity
thinkingserious commentedon Mar 15, 2017
Hello @PrinceVarshney,
I believe you are asking for us to update the dependency in sendgrid-java to support v4.1.0 of this library. Correct?
If so, here is the ticket for that: sendgrid/sendgrid-java#162 -- I will add your vote to that issue to grant it higher priority.
With Best Regards,
Elmer
PrinceVarshney commentedon Mar 15, 2017
Hei @thinkingserious
I am not able to get why its converting Ø -->Å , because the Client.java class has the UTF-8 support then why I am facing the issue.. ? Is this because of the dependency thats not included in sendgrid-java v3.1.0 ,I can externally include the dependency of httpClient if its required. But will it help. ? I need a urgent fix as we are moving in production in few days.
Please help!!
thinkingserious commentedon Mar 15, 2017
Hello @PrinceVarshney,
I'm not sure what is causing that issue, I am attempting to clarify with you.
Let me make sure my assumptions are correct:
Also, can you please provide me with the sample file so that I can try to re-create the issue?
Thanks!
Elmer
PrinceVarshney commentedon Mar 16, 2017
@thinkingserious
Yeah I am using sendgrid-java SDK v3.1.0.
We are creating runtime content and the name of the pdf visible to the user is
Pris og oppgjørsvilkår.pdf
that should be
Pris og oppgjørsvilkår.pdf
This is where I am attaching the file
Attachments attachments=new Attachments();
Charset.forName("UTF-8").encode(attachmentName);
attachments.setFilename(attachmentName);
attachments.setType(type);
attachments.setDisposition("attachment");
attachments.setContent(Base64.encodeBase64String(attachment));
List attachList = new ArrayList();
attachList.add(attachments);
emailDTO.setAttachment(attachList);
While sending it through sendgrid :
Attached the file for the reference-
sampleFile.txt
thinkingserious commentedon Mar 16, 2017
Hello @PrinceVarshney,
I was unable to reproduce the error, here is the code I used:
Perhaps the value in
attachmentNameis getting changed before you pass it into thesetFilenamefunction.PrinceVarshney commentedon Mar 16, 2017
Hey @thinkingserious
I hardcoded the value in the attachment name, then also I was facing the same error. You are using the same version of sendgrid-java. ?
thinkingserious commentedon Mar 16, 2017
@PrinceVarshney,
Yes, I am using the latest version 3.1.0.
Can you check the encoding on your source code editor?
PrinceVarshney commentedon Mar 16, 2017
@thinkingserious
Will it matter. ? I think you are talking about eclipse. ?
Whats the use of below line ?
sg.addRequestHeader("X-Mock", "true");
thinkingserious commentedon Mar 16, 2017
That line can be ignored, it is for when we use our local testing server. I just tried without that line with the same result.
For Eclipse: http://stackoverflow.com/questions/9180981/how-to-support-utf-8-encoding-in-eclipse
PrinceVarshney commentedon Mar 16, 2017
My request in the logs is printed correctly :
"type":"application/pdf","filename":"Pris og oppgjørsvilkår.pdf","disposition":"attachment"}
so does the eclipse encoding will matter.. ?
thinkingserious commentedon Mar 16, 2017
I'm not sure.
Can you please try sending your test email to elmer.thomas@sendgrid.com?
PrinceVarshney commentedon Mar 16, 2017
@thinkingserious
I have sent one mail on this id. One thing I observed that the issue is with MicrosoftOutlook only, in gmail its fine.
thinkingserious commentedon Mar 16, 2017
Hello @PrinceVarshney,
I have received the email correctly in GMail. Since the filename is correct on your server and in GMail, it appears the issue is with Outlook and that it might be a known problem.
I'm going to leave this issue open for further investigation. Perhaps there is some header that Microsoft Outlook requires to ensure UTF-0 encoding.
11 remaining items
PrinceVarshney commentedon Mar 17, 2017
@thinkingserious
Thank you !! Will fill the form once outside office network :)
thinkingserious commentedon Mar 11, 2021
Since there has been no activity on this issue since March 1, 2020, we are closing this issue. Please feel free to reopen or create a new issue if you still require assistance. Thank you!