We have a custom REST api that throws an error when ever we have a diacritic character as part of the JSON request. For example if the character "é" is anywhere in the JSON it errors when we convert to string.
Here is a snippet of the code:
@HttpPost
global static String fetcheRAMmsg()
{
RestRequest req = RestContext.request;
Map<String,String> eramFields = new Map<String,String>();
String ackId;
String errorMsg='None';
system.debug('%%% - About to Parse the JSON: ' );
system.debug('%%% - Headers from eRAM: '+req.headers);
system.debug('%%% - About to Convert to String' );
system.debug('%%% - JSON from eRAM: '+req.requestBody.toString());
JSONParser parser = JSON.createParser(req.requestBody.toString());
It fails at the .tostring()
command.
It works fine if there are no diacritic charcters in it. How do I check convert the BLOB to a string?