Remove Zero Width Space

This commit is contained in:
nilaoda 2022-07-02 01:09:10 +08:00
parent d21d3924cc
commit 1aef2a7504
1 changed files with 13 additions and 2 deletions

View File

@ -22,6 +22,17 @@ namespace N_m3u8DL_RE.Common.Entity
return Parse(Encoding.UTF8.GetString(textBytes));
}
/// <summary>
/// 从字节数组解析WEBVTT
/// </summary>
/// <param name="textBytes"></param>
/// <param name="encoding"></param>
/// <returns></returns>
public static WebSub Parse(byte[] textBytes, Encoding encoding)
{
return Parse(encoding.GetString(textBytes));
}
/// <summary>
/// 从字符串解析WEBVTT
/// </summary>
@ -66,9 +77,9 @@ namespace N_m3u8DL_RE.Common.Entity
{
StartTime = startTime,
EndTime = endTime,
Payload = payload,
Payload = string.Join("", payload.Where(c => c != 8203)), //Remove Zero Width Space!
Settings = style
});
}) ;
needPayload = false;
}
}