Support for "’" in scc - thx Mayte :)

This commit is contained in:
Nikolaj Olsson 2016-06-07 20:54:42 +02:00
parent 988b14c075
commit 22c96def55

View File

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Drawing;
using System.Globalization;
using System.Text;
@ -740,6 +741,25 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
i += 3;
italic--;
}
else if (text.Substring(i).StartsWith(""))
{
if (code.Length == 4)
{
sb.Append(code + " ");
code = string.Empty;
}
if (code.Length == 0)
{
code = "80";
}
if (code.Length == 2)
{
code += "a7";
sb.Append(code + " ");
}
code = "9229";
newCode = "";
}
else if (index < 0)
newCode = LetterCodes[Letters.IndexOf(" ")];
else
@ -1672,6 +1692,15 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
continue;
}
// skewed apos ""
if (part == "9229" && k < parts.Length - 1 && parts[k + 1] == "9229" && sb.EndsWith('\''))
{
sb.Remove(sb.Length - 1, 1);
sb.Append("");
k += 2;
continue;
}
if (part[0] == '9' || part[0] == '8')
{
if (k + 1 < parts.Length && parts[k + 1] == part)