Skip to Content

UTF-8 BOM encoding in SCPI doesn't work

Hi Experts,

I am intgerating SuccessFactors with Concur and they want UTF-8 with BOM. I have tried several scripts that's mentioned in below blog along with some changes as well but nothing really works. Do you know if it's still possible to enforce BOM?

Concur needs a text file so after converting it to file, I am setting CamelCharsetName as UTF-8 before the script.

I am using below script :



import java.util.HashMap;

import java.nio.charset.StandardCharsets;

def Message processData(Message message) {

Map headerMap = message.getHeaders();

def payload = message.getBody(java.lang.String) as String;

byte[] bom = [0xEF,0xBB,0xBF];

byte[] document = payload.getBytes(StandardCharsets.UTF_8);

byte[] withBom = new byte[bom.length + document.length];



String s2 = new String(withBom); message.setBody(s2);

return message;


I can see some special characters being populated but when I open the file in notepad++ it still shows encoding as UTF-8. Could you please help?



Add comment
10|10000 characters needed characters exceeded

0 Answers