From 097c5acd8caa5b84f72cbb43f9649e961c41118b Mon Sep 17 00:00:00 2001 From: niksedk Date: Thu, 14 Oct 2010 18:40:12 +0000 Subject: [PATCH] fixed bug in text reading method git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@46 99eadd0c-20b8-1223-b5c4-2a2b2df33de2 --- src/Logic/SubtitleFormats/Ebu.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Logic/SubtitleFormats/Ebu.cs b/src/Logic/SubtitleFormats/Ebu.cs index de40b2967..9cbd7811d 100644 --- a/src/Logic/SubtitleFormats/Ebu.cs +++ b/src/Logic/SubtitleFormats/Ebu.cs @@ -180,6 +180,10 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats const int TTISize = 128; const byte TextFieldCRLF = 0x8A; const byte TextFieldTerminator = 0x8F; + const byte ItalicsOn = 0x80; + const byte ItalicsOff = 0x80; + const byte UnderlineOn = 0x82; + const byte UnderlineOff = 0x83; Encoding encoding = Encoding.Default; //try @@ -216,9 +220,17 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats { if (buffer[index + 16 + i] == TextFieldCRLF) sb.AppendLine(); + else if (buffer[index + 16 + i] == ItalicsOn) + sb.Append(""); + else if (buffer[index + 16 + i] == ItalicsOff) + sb.Append(""); + else if (buffer[index + 16 + i] == UnderlineOn) + sb.Append(""); + else if (buffer[index + 16 + i] == UnderlineOff) + sb.Append(""); else if (buffer[index + 16 + i] == TextFieldTerminator) break; - else + else if (buffer[index + 16 + i] >= 0xA1) sb.Append(encoding.GetString(buffer, index+16+i, 1)); } tti.TextField = sb.ToString();