Users providing work notes with special characters. How to encode it?

Swarnarghya
Tera Expert

steps:
1)login any itil user

2)create incident and submit

3)provide random special characters and submit it

4) I need the special characters to be encoded. How to do it

3 REPLIES 3

Hitoshi Ozawa
Giga Sage
Giga Sage

>3)provide random special characters and submit it

I'm using Japanese and haven't had any problem with submitting incidents. Please paste the special character that needs to be included in an incident.

>4) I need the special characters to be encoded. How to do it

Encoded to what? There are several encoding schemes. Which one is needed?

ServiceNow saves string in UTF-8 and I haven't had problem with it.

Please provide a concrete example of text to be entered into an incident.

like & is written as %26. I want to do something like this

Hitoshi Ozawa
Giga Sage
Giga Sage

Not sure what's the purpose of converting string to hex.

Following code will convert a string to hex.

function toHex(str) {
  var result = '';
  for (var i=0; i<str.length; i++) {
    result += str.charCodeAt(i).toString(16);
  }
  return result;
}

ServiceNow also has a base64 encoder.

var str = "<string to encode>";
var res = GlideStringUtil.base64Encode(str);