The term you're looking for is
HTML encoding[
^].
For example, that string should be encoded as:
<exp2://Ticket/18918617>
There are a lot of characters which need to be encoded, so don't try rolling your own function. Most languages will provide a standard method to encode a string. For example:
function htmlEncode(value){
return $('<div/>').text(value).html();
}
function htmlEncode( html ) {
return document.createElement('div')
.appendChild( document.createTextNode( html ) )
.parentNode.innerHTML;
}
http://stackoverflow.com/questions/1219860/html-encoding-in-javascript-jquery[
^]