title: How to find and remove the invisible characters in text file using emacs
body: <p>I have a txt file named COPYING which is edited on windows. It contains windows style eol    </p>
  
  <pre><code>$ file COPYING 
  COPYING: ASCII English text, with CRLF line terminators
  </code></pre>
  
  <p>I tried to convert it to unix style using the dos2unix. The below is the output</p>
  
  <pre><code>$ dos2unix COPYING 
  dos2unix: Skipping binary file COPYING
  </code></pre>
  
  <p>I was surprised to find that dos2unix program reports it as an binary file. Then using some other editor(not emacs) i found that the file contains a control character. I am interested to find all the invisible characters in the file using emacs.</p>
  
  <p>By Googling i have found the following solution which uses tr </p>
  
  <pre><code>tr -cd '\11\12\40-\176' &lt; file_name
  </code></pre>
  
  <p>How to do the same in emacs way. I tried the hexl-mode. The hexl-mode shows text and their corresponding ascii values in a single buffer which is great. How to find the characters which has ASCII values other than 11-12, 40-176(i.e tab, space and visible characters). I tried to create a regular expression for that search, but it is quite complicated. </p>