Attachements with Chinese-character filenames appear incorrect
Pega was integrated with Filenet content manager to store the work object attachments. An email was created and sent to a case. The email had an attached file named in Chinese. Random characters and symbols appeared instead of Chinese characters when downloaded from the email. However, it appeared fine in Pega.
Steps to Reproduce
1. Create a correspondence rule.
2. Attach a file, which is named in Chinese.
3. Run the use case, which sends email along with attachments.
SendEmailMessage RUF was customized into the rule set, and a part of the code was missing from the RUF.
Add the following code to the SendEmailMessage RUF.
String attname = attach.getString("pyName");
//BUG-152335: added code to encode the attachment name
attname = javax.mail.internet.MimeUtility.encodeText(attname,charset,null);