1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//! Regression test for EBU STL binary input handling.
//!
//! Background: `parse_to_file` and `cmd_parse` (in `src/main.rs`) used
//! to run `encoding::decode_to_string(data)?` before dispatching to
//! format parsers. For EBU STL (binary), this could either fail with
//! InvalidEncoding OR silently produce garbage text (chardetng is
//! permissive). The fix hoists the EbuStl branch above the decode call.
//!
//! `parse_to_file`/`cmd_parse` are private to the binary crate, so we
//! can't unit-test them directly. Instead we verify the contract they
//! rely on: `ebu_stl::parse_content` accepts raw bytes WITHOUT going
//! through text decoding. If this stops being true, the CLI fix would
//! silently break.
use ebu_stl;
use SubtitleFormat;
/// A minimal valid EBU STL file: 1024-byte GSI + 1×128-byte TTI.
/// Bytes are 0xFF-heavy to mimic real binary STL content (GSI block
/// contains packed binary fields, not text).