Skip to content Skip to sidebar Skip to footer

Exoplayer - Weird Arabic/persian Subtitles Format

I'm trying to create a video player with subtitles. everything is set up and working correctly , except one thing. my Arabic subtitles are not showing correctly as they should be.

Solution 1:

The encoding of that file is windows-1256. you should change it to Unicode first and then you can see it correctly.

BufferedReader reader = new BufferedReader(
        new InputStreamReader(new FileInputStream("arabic sub.srt"), "windows-1256")
    );
String line = null;
BufferedWriter writer = new BufferedWriter(
    new OutputStreamWriter(new FileOutputStream("new.srt"), "UTF-8")
);
while((line = reader.readLine())!= null){        
    writer.write(line);
    writer.write("\r\n");
}
writer.close();

Post a Comment for "Exoplayer - Weird Arabic/persian Subtitles Format"