note
GlitchMr
<p>Just a note, <c>\x7F</c> is also unprintable character, In one of my scripts, I use following translation to filter non-printable characters.</p>
<c>tr[\0-\x1F\x7F]
[\x{2400}-\x{241F}\x{2421}]
</c>
<p><c>\x{2420}</c> is space, in case you have noticed a gap in range. If you don't want to replace them with Unicode non-printable graphics characters, you could replace <c>\x{2400}-\x{241F}\x{2421}</c> with <c>?</c> or <c>\x{FFFD}</c> (Unicode replacement character).</p>
<p>Also, in most cases you wouldn't want to match <c>\x09</c> (tab), <c>\x0A</c> (line feed) or <c>\x0D</c> (carriage return). You could use this translation when you don't want to match them.</p>
<c>tr[\0-\x08\x0B\x0C\x0E-\x1F\x7F]
[\x{2400}-\x{2408}\x{240B}\x{240C}\x{240E}-\x{241F}\x{2421}]
</c>
<p>It also doesn't work on EBCDIC, if you want to match EBCDIC, most likely you will need different range of characters (<c>\x00-\x3F\xFF</c>).</p>
988145
988145