title: Query mongoDB with German umlauts in Python
body: <p>I have a collection in mongoDB, which has documents containing a field "topic". There are German words (in capital) in these topic fields, such as "LANDSTRAßE", or "DÖBLIN". 
  I also have a text file, containing the same topics (but lowercase) in each line of it.
  I want to read the topics from my text file and query my collection based on them.
  But my query doesn't find the documents with that topic, even if the topic really exists in the collection.</p>
  
  <p>Here is how I read my text file:</p>
  
  <pre><code>THIS_FOLDER = os.path.dirname(os.path.abspath(__file__))
  topicsFileName = 'topics.txt'
  with io.open(os.path.join(THIS_FOLDER, 'Assets', topicsFileName), encoding='utf8', errors='replace') as st:
    topics = st.readlines()
  </code></pre>
  
  <p>Here is how I query the collection (for example for the first topic in my topics):</p>
  
  <pre><code># assuming that I have set up mongoDB collection correctly 
  cursor = db[collectionName].find({"topic": topics[0].upper().rstrip()})
  </code></pre>
  
  <p>Any idea, how I can make my query correctly? (The code works fine for the topics which don't have any umlaut in them, such as "MARIAHILF".)</p>