Repository navigation
Conversation
|
@cfsmp3 Small fix: with |
b60f41e to
cb94b43
Compare
CCExtractor CI platform finished running the test files on windows. 171/238 tests matched the approved output:
67 tests do not match the approved output. That is the pass/fail verdict. Whether this branch caused it is a separate question, answered below.
Compared with the tip of master — test 10057, commit abdd8d6:
Pass there, fail here:
Fail on both but produce different output — behaviour moved even though the verdict did not:
Fail there, pass here:
Compared with the commit this branch was cut from: the same run as the tip of master (test 10057), so the comparison above already covers it. This branch changes the behaviour of 15 test(s) relative to the tip of master. Those are the ones worth looking at; anything else in the list fails the same way on both sides. |
CCExtractor CI platform finished running the test files on linux. 171/238 tests matched the approved output:
67 tests do not match the approved output. That is the pass/fail verdict. Whether this branch caused it is a separate question, answered below.
Compared with the tip of master — test 10068, commit 604dad8:
Compared with the commit this branch was cut from: the same run as the tip of master (test 10068), so the comparison above already covers it. No test changes behaviour relative to the tip of master: every failure above fails there too, byte for byte. The approved output for those tests is out of date, which is a baseline to review rather than a regression in this branch. |
cfsmp3
left a comment
There was a problem hiding this comment.
This is Carlos' claude doing the first pass. Before Carlos takes a look, please address these issues.
Your table reproduces on c83f765c…06cd.ts:
CP949,UHC,EUCKR,CP936,CP950andEUCJPgo from 0 to 9 caption lines.EUC-KR,GBK,BIG5,SHIFT_JIS,EUC-JPandISO-8859-1are byte-identical to master.
One thing is left:
-
The alias table misses iconv names that encoding_rs can decode. These are accepted by
iconv_open()(glibc), so they get pastdtvcc_writer_init(). They aren't encoding_rs labels and aren't infind_charset_encoding(), so they end up in the "can't convert" path and are written unconverted:CP932is the Windows name for Japanese, the counterpart ofCP949. It should map toSHIFT_JIS(encoding_rs's Shift_JIS is windows-31j, i.e. CP932). On the sample,--service "1[CP932]"prints the notice and writes the raw bytes.WINDOWS-936andMS936should map toGBK.CP874should map toWINDOWS_874.
Please add them to the table and to
test_find_charset_encoding_iconv_names. Names encoding_rs really can't decode, likeJOHAB, can keep the notice and the unconverted fallback.
Also note that #2486 rewrites the same write_row() charset branch and output.rs, so whichever of the two merges second will need a rebase.
cb94b43 to
68515e8
Compare
|
Thanks for the review. Updated in 68515e8 (also rebased on master):
On the sample, each of the new names now gives the same file as its encoding_rs name ( Noted on #2486. I'll rebase if it goes in first. |
|
@cfsmp3 I've addressed the first-pass review (added CP932, WINDOWS-936, MS936 and CP874, rebased on master). Could you take another look when you have time? Thanks! |
In raising this pull request, I confirm the following (please check boxes):
Reason for this PR:
Sanity check:
Repro instructions:
Sample: c83f765c…06cd.ts (has CEA-708 service 1).
On master
604dad8e, every caption has its timing but no text, and nothing is printed:With this PR:
Caption text lines in
out.p1.svc01.srt(9 is the full file):EUC-KR,GBK,BIG5,SHIFT_JIS,ISO-8859-1CP949,UHC,EUCKREUC-KR)CP936,WINDOWS-936,MS936GBK)CP950BIG5)EUCJPEUC-JP)CP932SHIFT_JIS)CP874WINDOWS-874)JOHABProblem
The
--servicecharset name is checked in two places that don't agree:dtvcc_writer_init()(C) checks it withiconv_open()and exits if iconv doesn't know it.write_row()intv_screen.rsconverts with encoding_rs (since fix: replace iconv with encoding_rs #1698), usingEncoding::for_label().A name that iconv accepts but that isn't an encoding_rs label gets past step 1. Then
for_label()returnsNonein step 2, and the row is never written.CP949is the usual Windows name for Korean (the code comment right above even lists it as a supported charset), and it produces a file with empty captions and no error.Fix
find_charset_encoding()inoutput.rs: tryEncoding::for_label()first, then map the iconv names of encodings that encoding_rs does have (CP949/UHC/EUCKR→ EUC-KR,CP936/WINDOWS-936/MS936→ GBK,CP950→ Big5,EUCJP→ EUC-JP,CP932→ Shift_JIS,CP874→ windows-874). All of these got empty captions on master.JOHAB, which encoding_rs can't convert), write the text unconverted, as with no charset, and print one notice, instead of dropping it.Names that already worked go through the same code path as before.
Tests
write_rowturning EUC-KR bytes for가into UTF-8 withEUC-KR,CP949,UHCandEUCKR, andJOHABkeeping the text. All 3 fail on master and pass with the fix.cargo test: 451 passed (src/rust), 101 passed (lib_ccxr).cargo fmt --checkandcargo clippy -- -D warningsare clean in both crates.#2454 also edits
write_row()(how the symbol bytes are built). It doesn't touch the charset lookup, but if both get merged, whichever comes second may need a small rebase.