From fb6dca4f92e3020f8b36b0bb2db71e1d1e38a051 Mon Sep 17 00:00:00 2001 From: odrling Date: Sat, 10 Aug 2024 16:50:32 +0200 Subject: [PATCH] handle escaped all chars like libass https://github.com/libass/libass/blob/b214307994be88943f609408d3182dbc9a3371ae/libass/ass_parse.c#L1125 maybe should replace \t with spaces too but whatever --- libdakara_check.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libdakara_check.c b/libdakara_check.c index 09691c2..93dfb84 100644 --- a/libdakara_check.c +++ b/libdakara_check.c @@ -255,6 +255,8 @@ int dakara_check_external_sub_file_for(char *filepath) { return dakara_check_sub_file(sub_filepath); } +#define NBSP '\xa0' + /* * check events of the current track */ @@ -298,7 +300,15 @@ void dakara_check_subtitle_events(ASS_Track *track, dakara_check_sub_results *re case 'N': line[write_head++] = '\n'; break; + case 'h': + line[write_head++] = NBSP; + break; + case '{': + case '}': + line[write_head++] = line[read_head]; + break; default: + line[write_head++] = '\\'; line[write_head++] = line[read_head]; } } else {