oblac / jodd

Jodd! Lightweight. Java. Zero dependencies. Use what you like.

Home Page:https://jodd.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When I send one email with attachment, the attachment name is gibberish in Chinese.

huangfeinong opened this issue · comments

Current Result:
Attachment File Name:???-Billing-2007-014.pdf

Code Example:
InputStream fileInput = null;
String fileName = "对账单-Billing-2007-014.pdf ";
email = email.attachment(EmailAttachment.with().name(new String(fileName.getBytes(),"utf-8")).content(fileInput,null));

You don't need to new String(fileName.getBytes(),"utf-8"), just pass the fileName (if the source code is utf8 already.

Just committed test for this

please see it