title: Replace diacritics in python
body: <p>How can I replace diacritics in a srt file with normalized words?</p>
  <p>I have a romanian srt and I'm trying to stream a movie using jellyfin but I have a problem where the app doesn't support special characters like <code>ĂăÂâÎîȘșȚț</code> so I'm trying to get rid of them.</p>
  <p>I tried using unidecode but the words get weirdly replaced with <code>ț</code> -&gt; <code>th</code>, <code>ș</code> -&gt; <code>o</code></p>
  <p>'I've also tried just using sed to replace the characters but some chars like <code>ș</code> are displayed like <code>º</code> so the following function doesn't replace them:</p>
  <pre><code>def strip_accents(s):
      d = 'ĂăÂâÎîȘșȚț'
      n = 'AaAaIiSsTt'
      dl = [i for i in d]
      nl = [i for i in n]
      ii = 0
      for x in dl:
          s = re.sub(x, nl[ii], s)
          ii += 1
      return s
  </code></pre>