mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 11:12:36 +01:00
fixed bug in text reading method
git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@46 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
parent
c663231306
commit
097c5acd8c
@ -180,6 +180,10 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
|||||||
const int TTISize = 128;
|
const int TTISize = 128;
|
||||||
const byte TextFieldCRLF = 0x8A;
|
const byte TextFieldCRLF = 0x8A;
|
||||||
const byte TextFieldTerminator = 0x8F;
|
const byte TextFieldTerminator = 0x8F;
|
||||||
|
const byte ItalicsOn = 0x80;
|
||||||
|
const byte ItalicsOff = 0x80;
|
||||||
|
const byte UnderlineOn = 0x82;
|
||||||
|
const byte UnderlineOff = 0x83;
|
||||||
|
|
||||||
Encoding encoding = Encoding.Default;
|
Encoding encoding = Encoding.Default;
|
||||||
//try
|
//try
|
||||||
@ -216,9 +220,17 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
|||||||
{
|
{
|
||||||
if (buffer[index + 16 + i] == TextFieldCRLF)
|
if (buffer[index + 16 + i] == TextFieldCRLF)
|
||||||
sb.AppendLine();
|
sb.AppendLine();
|
||||||
|
else if (buffer[index + 16 + i] == ItalicsOn)
|
||||||
|
sb.Append("<i>");
|
||||||
|
else if (buffer[index + 16 + i] == ItalicsOff)
|
||||||
|
sb.Append("</i>");
|
||||||
|
else if (buffer[index + 16 + i] == UnderlineOn)
|
||||||
|
sb.Append("<u>");
|
||||||
|
else if (buffer[index + 16 + i] == UnderlineOff)
|
||||||
|
sb.Append("</u>");
|
||||||
else if (buffer[index + 16 + i] == TextFieldTerminator)
|
else if (buffer[index + 16 + i] == TextFieldTerminator)
|
||||||
break;
|
break;
|
||||||
else
|
else if (buffer[index + 16 + i] >= 0xA1)
|
||||||
sb.Append(encoding.GetString(buffer, index+16+i, 1));
|
sb.Append(encoding.GetString(buffer, index+16+i, 1));
|
||||||
}
|
}
|
||||||
tti.TextField = sb.ToString();
|
tti.TextField = sb.ToString();
|
||||||
|
Loading…
Reference in New Issue
Block a user