Subtitleedit: 3.5.9 adds line number to text for .srt file

Created on 20 Feb 2019  路  10Comments  路  Source: SubtitleEdit/subtitleedit

3.5.9 apparently handles UTF-8 BOM differently than previous version.

See the pictures for differences when loading the same .srt file in the two different versions.
It includes the line number for the next line when loading.

The .srt file is attached.

version3 5 4
version3 5 9

UTF8BOM_test.srt.zip

All 10 comments

This is not a BOM issue: there is only one BOM at the beginning of the file, as it should be. The problem is the file has duplicate line numbers:

00:01:10,040 --> 00:01:13,360
K-A-R...

2

2
00:01:16,840 --> 00:01:19,080
... A-N-T...

3

3
00:01:21,280 --> 00:01:23,720
... 脝-N-E.

You can use the following regex in a text editor to remove them (find and replace with nothing):

^(\d+)(\r?\n)+(?=\1\r?\n\d+:\d+:\d+,\d+ --> \d+:\d+:\d+,\d+)

Actually that is caused by the software as well.. Didn't realize it did that before now.

I've attached the original file (which is used for the screenshot) and it doesn't contain double line numbers
full_file.srt.zip

Yeah, it's doing the same thing with vtt files, adding a line number just like this.

What do you mean by "double UTF-8 BOM"? I've checked the original file in a hex editor, and it has a normal single BOM, "EF BB BF".

@aaaxx you're right. I just thought another BOM was added because of a script converting subtitles.

I've edited the title to reflect what we know at this point :)

I thought this was only happening with files that are converted from Vtt when I mentioned it here https://github.com/SubtitleEdit/subtitleedit/issues/3383
I guess it's happening with many files.

@SirEllert: thx for the info - the error was due to a space after time codes. SE should now handle spaces after (and before) time codes better now: https://github.com/SubtitleEdit/subtitleedit/releases/download/3.5.9/SubtitleEditBeta.zip

@niksedk it seems to be the same with the file I had, too.
But why was 3.5.8 able to handle it just fine?

I added some unit tests, so hopefully this should not happen again.

Was this page helpful?
0 / 5 - 0 ratings