[英]org.apache.commons.mail attachment file name encoding
I'm using apache commons mail for sending e-mails with attachments. 我正在使用apache commons邮件发送带附件的电子邮件。 My attachment file content is in hebrew and I can see it when I open the file , my problem is when the attachment file name is in hebrew I can't see the name I see ??? 我的附件文件内容是希伯来语,当我打开文件时我可以看到它,我的问题是当附件文件名是希伯来语时我看不到我看到的名字??? instead. 代替。 (the content I still see ok). (内容我还是看好了)。
this is my code: 这是我的代码:
String attachment_file_name = "קובץ מס 1";
HtmlEmail email = new HtmlEmail();
email.setHostName(smtp_server);
email.addTo(to_email;
email.setFrom(from_email , "XXXXXXX");
email.setSubject(subject);
email.setCharset("UTF-8");
email.setHtmlMsg(body);
email.attach(new ByteArrayDataSource(attachment_file_.toByteArray(), "application/pdf"),
attachment_file_name ,
"attachment pdf",
EmailAttachment.ATTACHMENT);
email.send();
what do I need to do inorder to see the file name in hebrew (in the correct encoding) ? 为了看到希伯来语中的文件名(正确的编码),我需要做什么?
Thank's In Advance. 提前致谢。
I believe you have to encode it. 我相信你必须编码它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.