Question
JLL
IN
Last activity: 16 Mar 2020 8:41 EDT
Special characters appearing in email
Hi,
Special characters are being sent in email for some of the customers. We are using soap request to fetch the body of the email from external system and in response we get Base 64 encoded string. When i try to decode that string in notepad++, i can see the charset is iso-8859-1. However we are decoding it using below java
try{
decodedContent = new String(javax.xml.bind.DatatypeConverter.parseBase64Binary(encodedContent));
}
and the decodedContent is set to .pyBody in pyCorrPage.
While sending the email message to customer, we are usoing below code where i can see charet is mentioned as UTF-8
MimeBodyPart msgPart = new MimeBodyPart();
if( emailType.equals("HTML") ){
msgPart.setContent(msgBodyText, "text/html; charset=\"UTF-8\"");
}else{
msgPart.setContent(msgBodyText, "text/plain; charset=\"UTF-8\"");
}
multipart = new javax.mail.internet.MimeMultipart();
multipart.addBodyPart(msgPart);
//multipart = SMIMEgen.generate(msgPart, "BC");
}catch (Exception Any){
String strStatus = "SendEmailMessage: Could not set up e-mail signing: \n" + Any.toString();
oLog.error(strStatus);
return strStatus;
}
Also we are using microsoft exchange to send the emails.
Hi,
Special characters are being sent in email for some of the customers. We are using soap request to fetch the body of the email from external system and in response we get Base 64 encoded string. When i try to decode that string in notepad++, i can see the charset is iso-8859-1. However we are decoding it using below java
try{
decodedContent = new String(javax.xml.bind.DatatypeConverter.parseBase64Binary(encodedContent));
}
and the decodedContent is set to .pyBody in pyCorrPage.
While sending the email message to customer, we are usoing below code where i can see charet is mentioned as UTF-8
MimeBodyPart msgPart = new MimeBodyPart();
if( emailType.equals("HTML") ){
msgPart.setContent(msgBodyText, "text/html; charset=\"UTF-8\"");
}else{
msgPart.setContent(msgBodyText, "text/plain; charset=\"UTF-8\"");
}
multipart = new javax.mail.internet.MimeMultipart();
multipart.addBodyPart(msgPart);
//multipart = SMIMEgen.generate(msgPart, "BC");
}catch (Exception Any){
String strStatus = "SendEmailMessage: Could not set up e-mail signing: \n" + Any.toString();
oLog.error(strStatus);
return strStatus;
}
Also we are using microsoft exchange to send the emails.
This issue is happening to few customers and wherever we have   in html code is replaced with special character.
Can anyone please help me with this issue.
***Moderator Edit-Vidyaranjan: Updated Platform Capability***