Created
January 29, 2016 15:41
-
-
Save rasoulian/5f9ba199863433fa1f65 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SubtitleTools{ | |
string _filePath = string.Empty; | |
public PersianSubtitle(string filePath){ | |
if (Path.GetExtension(filePath) != ".srt"){ | |
Console.WriteLine("Unknown file type!"); | |
} | |
} | |
public void ToPersian(){ | |
var reader = new StreamReader(_filePath, Encoding.GetEncoding("Windows-1256")); | |
string str2 = reader.ReadToEnd(); | |
reader.Close(); | |
var writer = new StreamWriter(path.Substring(0, _filePath.Length - 4) + ".edited.srt", false, Encoding.UTF8); | |
writer.Write(str2); | |
writer.Close(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment