mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-03 21:23:48 +00:00
[PR #2038] fix(rust): Support BCP 47 language tags in --mkvlang option #2850
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?
Original Pull Request: https://github.com/CCExtractor/ccextractor/pull/2038
State: closed
Merged: Yes
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