JSON / REST special character problems: a solution

use base64 encoding and decoding to get around it

  • in the REST message (outbound request): 

var wnotes_base64Encode=GlideStringUtil.base64Encode(worknote);

r.setStringParameter('u_work_notes', wn_base64encoded);

  • in the counterpart REST endpoint code (ServiceNow example) (incoming): 

var sdesc_base64Decoded=GlideStringUtil.base64Decode(wnotes_base64Encode);


Popular posts from this blog

GlideRecord setValue

variable advanced reference qualifier example

URL link in addInfoMessage