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)); 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> /// <summary>
/// 从字符串解析WEBVTT /// 从字符串解析WEBVTT
/// </summary> /// </summary>
@ -66,7 +77,7 @@ namespace N_m3u8DL_RE.Common.Entity
{ {
StartTime = startTime, StartTime = startTime,
EndTime = endTime, EndTime = endTime,
Payload = payload, Payload = string.Join("", payload.Where(c => c != 8203)), //Remove Zero Width Space!
Settings = style Settings = style
}) ; }) ;
needPayload = false; needPayload = false;