Force Encore subtitles to UTF-8 as Encore doesn't like non-unicode encodings

Originally committed to SVN as r6469.
This commit is contained in:
Thomas Goyne 2012-02-14 00:35:16 +00:00
parent fae7261bd0
commit 105a6bd68a
2 changed files with 3 additions and 4 deletions

View File

@ -53,12 +53,10 @@ wxArrayString EncoreSubtitleFormat::GetWriteWildcards() const {
return formats;
}
void EncoreSubtitleFormat::WriteFile(const AssFile *src, wxString const& filename, wxString const& encoding) const {
void EncoreSubtitleFormat::WriteFile(const AssFile *src, wxString const& filename, wxString const&) const {
FractionalTime ft = AskForFPS(true);
if (!ft.FPS().IsLoaded()) return;
TextFileWriter file(filename, encoding);
// Convert to encore
AssFile copy(*src);
copy.Sort();
@ -74,6 +72,7 @@ void EncoreSubtitleFormat::WriteFile(const AssFile *src, wxString const& filenam
// Encore wants ; instead of : if we're dealing with NTSC dropframe stuff
char sep = ft.IsDrop() ? ';' : ':';
TextFileWriter file(filename, "UTF-8");
for (LineList::const_iterator cur = copy.Line.begin(); cur != copy.Line.end(); ++cur) {
if (AssDialogue *current = dynamic_cast<AssDialogue*>(*cur)) {
++i;

View File

@ -46,5 +46,5 @@ class EncoreSubtitleFormat : public SubtitleFormat {
public:
EncoreSubtitleFormat();
wxArrayString GetWriteWildcards() const;
void WriteFile(const AssFile *src, wxString const& filename, wxString const& encoding) const;
void WriteFile(const AssFile *src, wxString const& filename, wxString const&) const;
};