Dear Experts,
I'm trying to add BOM (Byte Order Mark) characters to UTF-8 file content thru Groovy script while sending file to 3rd party SFTP server.

import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.HashMap;
def Message processData(Message message) {
Map headerMap = message.getHeaders();
def payload = message.getBody(java.lang.String);
String bom = new String("\u00EF\u00BB\u00BF"); //"0xEF,0xBB,0xBF";
//Add ByteOrderMark to payload
payload = bom+payload;
message.setBody(payload);
return message;
}The file created at the target does not have correct BOM characters and failing in target. When examined the target file with Hex editor we can clearly see that the BOM is not correct (the same code in Groovy console is creating correct BOM so editors like Notepad & Notepad++ recognize correctly as UTF-8 with BOM).
Correct BOM & Text Content (expected) as viewed in -- HEX -- Mode

Correct BOM & Text Content (expected) as viewed in -- Normal -- Mode

Incorrect BOM (produced by HCI thru Groovy) in -- HEX -- Mode

Anybody experienced similar issue and found any work around to fix the issue?
Thanks in advance.
Ananth Chinnaraj