[SOLVED] Fixed in Spring Framework:
restTemplate.getMessageConverters()
.add(0, new StringHttpMessageConverter(Charset.forName("UTF-8")));
I have cyrillic characters in response. I prefer using void method with RestContext because I use HTTP error codes for errors.
global class SalesOrder {
global String name; //contains cyrillic letters
...
}
Works:
@HttpGet
global static SalesOrderWrapper getSalesOrder() {
...
return salesOrder;
}
Does not work (question marks instead of text):
@HttpGet
global static void getSalesOrder() {
...
RestContext.response.responseBody = Blob.valueOf(JSON.serialize(salesOrder));
}
This does not help:
response.headers.put('Content-Type', 'application/json');
response.headers.put('charset', 'UTF-8');