Users providing work notes with special characters. How to encode it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2022 11:48 PM
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
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2022 12:03 AM
>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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2022 12:14 AM
like & is written as %26. I want to do something like this

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2022 12:44 AM
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);