mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-03 21:23:48 +00:00
[PR #2038] [MERGED] fix(rust): Support BCP 47 language tags in --mkvlang option #2845
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/CCExtractor/ccextractor/pull/2038
Author: @cfsmp3
Created: 1/18/2026
Status: ✅ Merged
Merged: 1/19/2026
Merged by: @cfsmp3
Base:
master← Head:fix/mkvlang-extended-codes📝 Commits (2)
91d3512fix(rust): Support BCP 47 language tags in --mkvlang option298665fchore: fix cargo fmt formatting📊 Changes
6 files changed (+404 additions, -30 deletions)
View changed files
📝
docs/CHANGES.TXT(+1 -0)➕
src/rust/lib_ccxr/src/common/mkv_lang.rs(+385 -0)📝
src/rust/lib_ccxr/src/common/mod.rs(+2 -0)📝
src/rust/lib_ccxr/src/common/options.rs(+3 -2)📝
src/rust/src/common.rs(+6 -7)📝
src/rust/src/parser.rs(+7 -21)📄 Description
Summary
The
--mkvlangoption previously only supported single ISO 639-2 codes due to using aLanguageenum with a fixed list of variants. Extended codes (likefre-ca) and multiple codes (likeeng,chi) would panic with "VariantNotFound".This change introduces
MkvLangFilter, a proper type for language filtering that:eng)en-US,zh-Hans-CN)The C code continues to receive the raw string for
strstr()matching, maintaining backward compatibility.Test plan
cargo test mkv_lang)--mkvlang eng,fre- works--mkvlang en-US,fr-CA- works (previously crashed)--mkvlang zh-Hans-CN- works (previously crashed)--mkvlang a- clean error message--mkvlang ç- clean error message (previously panicked)🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.