[PR #1821] [MERGED] fix(teletext): Add --ttxtforcelatin option to force Latin G0 charset #2568

Open
opened 2026-01-29 17:22:49 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/CCExtractor/ccextractor/pull/1821
Author: @cfsmp3
Created: 12/14/2025
Status: Merged
Merged: 12/14/2025
Merged by: @cfsmp3

Base: masterHead: fix/issue-1395-teletext-latin-charset


📝 Commits (1)

  • 26f3174 fix(teletext): Add --ttxtforcelatin option to force Latin G0 charset

📊 Changes

6 files changed (+23 additions, -1 deletions)

View changed files

📝 src/lib_ccx/lib_ccx.h (+2 -1)
📝 src/lib_ccx/telxcc.c (+8 -0)
📝 src/rust/lib_ccxr/src/teletext.rs (+3 -0)
📝 src/rust/src/args.rs (+5 -0)
📝 src/rust/src/common.rs (+1 -0)
📝 src/rust/src/parser.rs (+4 -0)

📄 Description

Summary

  • Added new --ttxtforcelatin command-line option
  • Forces teletext G0 character set to Latin, ignoring Cyrillic designations in the stream
  • Fixes garbled output where Latin text appears as Cyrillic characters

Problem

Some broadcast streams (e.g., UK Freesat recordings) incorrectly signal Cyrillic character set via X/28 or M/29 teletext packets when the actual content is Latin English text.

Before (garbled Cyrillic):

Но. Нот бацк тхен, анiваi.

Expected (correct Latin):

No. Not back then, anyway.

Root Cause

The broadcast stream contains triplet value 0x1290 which has:

  • Bits 10-13 = 0x1 (Cyrillic character set family per ETS 300 706 Table 32)
  • Bits 7-9 = 0x5 (Ukrainian option)

This causes CCExtractor to select CYRILLIC3 (Ukrainian) charset instead of Latin.

Solution

Added --ttxtforcelatin option that bypasses the Cyrillic character set detection and always uses Latin G0 charset.

Changes

  • src/lib_ccx/lib_ccx.h: Added forceg0latin field to teletext config
  • src/lib_ccx/telxcc.c: Modified set_g0_charset() to respect forceg0latin option
  • src/rust/src/args.rs: Added --ttxtforcelatin CLI argument
  • src/rust/src/parser.rs: Added argument handling
  • src/rust/src/common.rs: Added field to struct conversion
  • src/rust/lib_ccxr/src/teletext.rs: Added forceg0latin to TeletextConfig

Test plan

  • Downloaded sample from issue #1395
  • Reproduced the Cyrillic output issue
  • Verified --ttxtforcelatin produces correct Latin output
  • Build succeeds for both C and Rust components

Usage

ccextractor input.ts --ttxtforcelatin -o output.srt

Fixes #1395

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/CCExtractor/ccextractor/pull/1821 **Author:** [@cfsmp3](https://github.com/cfsmp3) **Created:** 12/14/2025 **Status:** ✅ Merged **Merged:** 12/14/2025 **Merged by:** [@cfsmp3](https://github.com/cfsmp3) **Base:** `master` ← **Head:** `fix/issue-1395-teletext-latin-charset` --- ### 📝 Commits (1) - [`26f3174`](https://github.com/CCExtractor/ccextractor/commit/26f317414b958c4386a30c4a01d3a518f0866851) fix(teletext): Add --ttxtforcelatin option to force Latin G0 charset ### 📊 Changes **6 files changed** (+23 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/lib_ccx/lib_ccx.h` (+2 -1) 📝 `src/lib_ccx/telxcc.c` (+8 -0) 📝 `src/rust/lib_ccxr/src/teletext.rs` (+3 -0) 📝 `src/rust/src/args.rs` (+5 -0) 📝 `src/rust/src/common.rs` (+1 -0) 📝 `src/rust/src/parser.rs` (+4 -0) </details> ### 📄 Description ## Summary - Added new `--ttxtforcelatin` command-line option - Forces teletext G0 character set to Latin, ignoring Cyrillic designations in the stream - Fixes garbled output where Latin text appears as Cyrillic characters ## Problem Some broadcast streams (e.g., UK Freesat recordings) incorrectly signal Cyrillic character set via X/28 or M/29 teletext packets when the actual content is Latin English text. **Before (garbled Cyrillic):** ``` Но. Нот бацк тхен, анiваi. ``` **Expected (correct Latin):** ``` No. Not back then, anyway. ``` ## Root Cause The broadcast stream contains triplet value `0x1290` which has: - Bits 10-13 = 0x1 (Cyrillic character set family per ETS 300 706 Table 32) - Bits 7-9 = 0x5 (Ukrainian option) This causes CCExtractor to select CYRILLIC3 (Ukrainian) charset instead of Latin. ## Solution Added `--ttxtforcelatin` option that bypasses the Cyrillic character set detection and always uses Latin G0 charset. ## Changes - `src/lib_ccx/lib_ccx.h`: Added `forceg0latin` field to teletext config - `src/lib_ccx/telxcc.c`: Modified `set_g0_charset()` to respect `forceg0latin` option - `src/rust/src/args.rs`: Added `--ttxtforcelatin` CLI argument - `src/rust/src/parser.rs`: Added argument handling - `src/rust/src/common.rs`: Added field to struct conversion - `src/rust/lib_ccxr/src/teletext.rs`: Added `forceg0latin` to TeletextConfig ## Test plan - [x] Downloaded sample from issue #1395 - [x] Reproduced the Cyrillic output issue - [x] Verified `--ttxtforcelatin` produces correct Latin output - [x] Build succeeds for both C and Rust components ## Usage ```bash ccextractor input.ts --ttxtforcelatin -o output.srt ``` Fixes #1395 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 17:22:49 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#2568