title: open html file to read its source for searching for a particular tag
body: <p>I'm unable to open an html file in read mode to search for a string match in its source.</p>
  
  <pre><code>fo = open("htm1.html", "r");
  str = fo.read(10);
  print("Read String is : ", str);
  fo.close();
  </code></pre>
  
  <p>This is not working.  I am getting following error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:/Python33/myProjects/malCode.py", line 34, in &lt;module&gt;
      str = fo.read(10);
    File "C:\Python33\lib\encodings\cp1252.py", line 23, in decode
      return codecs.charmap_decode(input,self.errors,decoding_table)[0]
  UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 6040: character maps to &lt;undefined&gt;
  </code></pre>