title: Python: parse XML with utf-8 (cyrillic) as string
body: <p>I need to read xml file as a string (not to parse it). Problem is, it is all in Cyrillic, and I failed reading (or, at least, printing) the string in a good way.</p>
  
  <p>my attempts:</p>
  
  <pre><code>with open (path, "r" ) as myfile:
      return myfile.read().replace('\n', '')
  
  
  with open (path, "r" ) as myfile:
       return unicode(myfile.read().replace('\n', ''),encoding='utf8')
  </code></pre>
  
  <p>both work, and I've been able to operate on string in first case - but still cannot print it</p>
  
  <p>UPDATE</p>
  
  <p>It looks like I pointed in the wrong direction with this problem: I use Jupyther notebooks, so the same issue even with "ordinal" cases:</p>
  
  <pre><code>import re
  
  text = '&lt;p id="p755"&gt;После Смоленска Наполеон'
  
  m = re.search('(?:&lt;p.*&gt;)(.*)', text)
  if m:
      found = m.group(1)
  
  found
  '\xd0\x9f\xd0\xbe\xd1\x81\xd0\xbb\xd0\xb5 \xd0\xa1\xd0\xbc\xd0\xbe\xd0\xbb\xd0\xb5\xd0\xbd\xd1\x81\xd0\xba\xd0\xb0 \xd0\x9d\xd0\xb0\xd0\xbf\xd0\xbe\xd0\xbb\xd0\xb5\xd0\xbe\xd0\xbd'
  </code></pre>