10
09/2014
entity 2 css content
function string_as_unicode_escape(input) { function pad_four(input) { var l = input.length; if (l == 0) return '0000'; if (l == 1) return '000' + input; if (l == 2) return '00' + input; if (l == 3) return '0' + input; return input; } var output = ''; for (var i = 0, l = input.length; i < l; i++) output += '\\u' + pad_four(input.charCodeAt(i).toString(16)); return output; } console.log(string_as_unicode_escape$('#test-bull').text()));