Skip to content
Novus Examples

Caption files with awkward encodings and line endings

The same cue list written with a UTF-8 BOM, without one, in UTF-16, with CRLF and with bare LF, plus non-Latin scripts and right-to-left text — for finding the parser that assumed captions are always LF-terminated ASCII.

18 of 18 files
Preview of SRT — UTF-8, LF
srt
352 B

SRT — UTF-8, LF

Plain UTF-8, no byte-order mark, Unix LF line endings. The reference member of this set — every other file here carries the same five cues, so a parser's output can be diffed against this one. Identical cue content across the whole set, so any difference in a parser's output is an encoding bug and nothing else.

Preview of SRT — UTF-8 with BOM, LF
srt
355 B

SRT — UTF-8 with BOM, LF

UTF-8 with a leading U+FEFF byte-order mark. Windows caption tools emit this constantly, and a parser that does not strip it sees the BOM as part of the first cue number and fails to match its index. Identical cue content across the whole set, so any difference in a parser's output is an encoding bug and nothing else.

Preview of SRT — UTF-8, CRLF
srt
372 B

SRT — UTF-8, CRLF

UTF-8 with Windows CRLF line endings. Parsers that split on a bare \n leave a trailing carriage return on every line, which usually surfaces as a stray box glyph at the end of each caption. Identical cue content across the whole set, so any difference in a parser's output is an encoding bug and nothing else.

Preview of SRT — UTF-16 LE with BOM
srt
686 B

SRT — UTF-16 LE with BOM

UTF-16 little-endian with a BOM. Every second byte is NUL, so a parser that reads bytes as UTF-8 or ASCII sees a file that appears to start and end immediately. Tools must detect the BOM, not assume UTF-8. Identical cue content across the whole set, so any difference in a parser's output is an encoding bug and nothing else.

Preview of SCC — Broadcast CEA-608 Captions
scc
308 B

SCC — Broadcast CEA-608 Captions

Broadcast closed captions as Scenarist SCC: SMPTE timecodes followed by hexadecimal CEA-608 byte pairs, with odd parity set on every byte as the standard requires. Uses pop-on mode — RCL to load, ENM to clear non-displayed memory, a preamble address code for row 15, the character pairs, then EOC to display. This is the fixture that exposes decoders which treat captions as text: the parity bits, the two-byte control codes and the frame-accurate timecodes all have to be handled.

Preview of VTT — Positioned and Aligned Cues
vtt
455 B

VTT — Positioned and Aligned Cues

WebVTT cues carrying the full positioning grammar — line, position, align and size — plus named cue identifiers instead of numbers. Captions are placed at four different points in the frame, which is what real subtitles do to avoid covering burned-in text. Parsers that treat everything after the timestamp as cue text will fold these settings into the visible caption.

Preview of SRT — Windows-1252 (Legacy Code Page)
srt
342 B

SRT — Windows-1252 (Legacy Code Page)

The same cues in Windows-1252, the legacy code page behind most real-world caption mojibake. Pure ASCII until the curly quotes and em dash, which encode as single bytes 0x93, 0x94 and 0x97 — none of which is valid UTF-8. A tool that assumes UTF-8 either raises or silently substitutes replacement characters exactly where the punctuation was. There is no BOM and no in-band signal, so correct handling requires either charset detection or being told.

Preview of SRT — No Trailing Newline
srt
351 B

SRT — No Trailing Newline

Identical to the reference file except the final newline is missing, so the last cue is terminated by end-of-file rather than by a blank line. SubRip separates cues with a blank line, and parsers that split on a double newline and discard the remainder drop the final cue entirely — a bug that is invisible until a file happens to end this way.

Preview of SRT — Mixed CRLF and LF Line Endings
srt
359 B

SRT — Mixed CRLF and LF Line Endings

One file with both line-ending conventions — CRLF for the opening cues and bare LF for the rest, the shape a caption file takes after being edited on two platforms or assembled from two sources. Parsers that detect the convention once from the first line and then apply it to the whole file mis-split everything after the switch.

Preview of VTT — UTF-8 With BOM Before the Signature
vtt
363 B

VTT — UTF-8 With BOM Before the Signature

WebVTT with a byte-order mark ahead of the mandatory WEBVTT signature. The spec explicitly allows this, and browsers accept it — but a naive check that the file literally starts with the six bytes 'WEBVTT' rejects a perfectly valid file. The mirror image of the missing-header corrupt fixture: one is valid and often refused, the other is invalid and often accepted.