I just came across the same problem while searching for Unicode characters inside a text and was not able to find a solution.
So I made a basic one at https://jsfiddle.net/boppy/3orednps/8/
Please accept this as a starting point only. I made it for being used in chrome and only adopted minor things to be able to run in FF. - At least it adds all the chars OP asked for.
It basically is (respect the order!):
// _spc ==> Single Space Char chr(32)
html = html.replace(/ /g, '<span class="_m _spc">·</span>');
// _tab ==> Tab Stops chr(9)
html = html.replace(/\t/g, '<span class="_m _tab"></span>');
// CarriageReturn chr(13)
html = html.replace(/\r/g, '');
// _brk ==> NewLine chr(10)
html = html.replace(/\n/g, '<span class="_m _brk">¶</span><br>');
// _np ==> non-printable lower ASCII range chr(0)...chr(31) + personally known char(s)
html = html.replace(/([\u0000-\u001F\u00AD])/g, '<span class="_m _np">$1</span>');
// _uc ==> Upper unicode range starting chr(255)
html = html.replace(/([\u00FF-\u9999])/g, '<span class="_m _uc">$1</span>');