File Name with few special characters are getting replaced with their hex value

File Name with few special characters are getting replaced with their hex value when sent as email attachment. (E.g.- Test(1).pdf showing up as Test$281$29.pdf). Under Pega case attachments, name is showing up correctly. Encoding is also set to UTF-8.

Can someone pls help with this. Thanks!

Hi @soodn, Is this issue resolved? I am facing issue when attaching file name with ( ) showing $281$29.

@RAVIKUMART-1 - Is this resolved? we are also facing same issue

@SivaprasadnaiduD @RAVIKUMART-1 this issue sounds like BUG-204903

Resolved Issues

Added special character decoding for outgoing email attachments

RESOLVED IN PEGA VERSION 7.1.9

Previously, code was added to the system to fix the cross-OS issue of special characters in file attachment names like [,],(,),{,},,. As part of the fix, the file names are encoded before being saved to the database. However, when those attachment are retrieved and sent out again as email attachments, the encoded characters were visible instead of the decoded values. To complete the decoding process, the file name will be handled with StringUtils.decodeCrossOSString(strfilename).

[decodeCrossOSString](https://community.pega.com/sites/pdn.pega.com/files/help_v74/javadocs/com/pega/pegarules/pub/util/StringUtils.html#decodeCrossOSString-java.lang.String-)(java.lang.String s)

Decodes a string into into its original chars based on the encoded, UTF-8 legal, cross-OS string.

If you have added special character decoding for outgoing email attachments you will need to decode the string that was used for the file name before saving the attachment:

NameOfMyFile = StringUtils.decodeCrossOSString(NameOfMyFile);

Did you review your Trace?

Can you confirm the issue is coming from the Activity Work- AttachFile.?

Step 11 - the java step called StringUtils.encodeCrossOSString

Are you using any custom activities?

Also have a look at the Pega Platform 8.7.4 Patch Resolved Issues

Handling added for illegal character in filename exception”

Suggestion:

→ Please log a support incident via the MSP to have this looked at in details. Can you report the INC id here so that we can help track it?

@RAVIKUMART-1 @SivaprasadnaiduD

Hi, yes this was resolved with the following solution:

OOTB function to use to decode : StringUtils.decodeCrossOSString(encodedString);

Please refer the below java steps we used in the activity:

String strAttchName = tools.getParamValue(“actualString”);

oLog.infoForced(“Venkat:ActualString —>”+ strAttchName);

String encodeString = StringUtils.encodeCrossOSString(strAttchName );

oLog.infoForced(“Venkat:encodeString —>”+ encodeString);

String decodeString = StringUtils.decodeCrossOSString(encodeString);

oLog.infoForced(“Venkat:decodeString —>”+ decodeString);

After using function @pxDecodeCrossOSString , we are getting attachment names with parenthesis in outlook properly.