# Character Encoding Problem with ReadList

I have a .srt file (subtitle file) with the following text:

Chapitre 1 : Systèmes d'équations linéaires et matrices

However when I import it into Mathematica, using:

subRip = ReadList[subRibFile, String];


I get:

Chapitre 1 : SystÃ¨mes d'Ã©quations linÃ©aires et matrices

How can I avoid that ?

• What do you get if you do Import[ subRibFile, "Text"]? Oct 7, 2018 at 11:10
• @JasonB. Thanks for your comment. In that case, I get one string which is not seperated by lines... but the output is correctly decoded. :) Oct 7, 2018 at 11:51

## 1 Answer

This is a bit of a workaround, using "import" but it works !

subRipIm = Import[subRibFile, "Text", CharacterEncoding -> "UTF8"];
subRip = DeleteCases[StringSplit[ToString[subRipIm], "\n"], ""];

• Thanks a lot ! This works ! :) Oct 7, 2018 at 11:52