Thanks for reporting your issue. Please make sure these boxes are checked before submitting your issue - thank you!

- [x] I looked for a similar issue and couldn't find any.
- [x] I tried with the latest version of GPAC. Installers available at http://gpac.io/downloads/gpac-nightly-builds/
- [x] I give enough information for contributors to reproduce my issue (meaningful title, github labels, platform and compiler, command-line ...). I can share files anonymously with this dropbox: https://www.mediafire.com/filedrop/filedrop_hosted.php?drop=eec9e058a9486fe4e99c33021481d9e1826ca9dbc242a6cfaab0fe95da5e5d95

Detailed guidelines: http://gpac.io/2013/07/16/how-to-file-a-bug-properly/

---

Attempting to use BCP 47 language tags such as `{cmn,yue}-{Hans,Hant,CN,TW}` results in an error and files being tagged `und`. These should be recognized for `elng` and the old langauge element set to `chi` (since there wasn't support for `cmn`/`yue` in the old standard).

```
❯ mp4box -for-test -add 'magic.crystal.mp4#video' -add 'magic.crystal.mp4#audio:lang=yue:name=Cantonese' -add 'magic.crystal.yue-Hant.forced.srt:lang=yue-Hant:txtflags=0xC0000000:name=Cantonese (Traditional) (Forced)' -add 'magic.crystal.cmn-Hans.srt:lang=cmn-Hans:name=Mandarin (Simplified)' -add 'magic.crystal.cmn-Hant.srt:lang=cmn-Hant:name=Mandarin (Traditional)' -add 'magic.crystal.eng.srt:lang=en' -tmp ~/tmp/mp4box -brand mp42isom -ab dby1 -no-iod -enable 1 Magic.Crystal.1986.2160p.WEB-DL.AAC2.0.DV.HDR.H.265-ECLiPSE.mp4
IsoMedia import magic.crystal.mp4 - track ID 1 - Video (size 3840 x 2160)
IsoMedia import magic.crystal.mp4 - track ID 2 - Audio (SR 48000 - 2 channels)
Track Importing Timed Text - Text track 3840 x 2160 font Serif (size 18) layer 0
The given code is not a valid one: yue-Hant, using 'und' as 3-letter code
Track Importing Timed Text - Text track 3840 x 2160 font Serif (size 18) layer 0
The given code is not a valid one: cmn-Hans, using 'und' as 3-letter code
Track Importing Timed Text - Text track 3840 x 2160 font Serif (size 18) layer 0
The given code is not a valid one: cmn-Hant, using 'und' as 3-letter code
Track Importing Timed Text - Text track 3840 x 2160 font Serif (size 18) layer 0
0.500 secs Interleaving
```

```
❯ mp4box -version
MP4Box - GPAC version 2.1-DEV-rev223-ge4df874e7-master
(c) 2000-2022 Telecom Paris distributed under LGPL v2.1+ - http://gpac.io

Please cite our work in your research:
        GPAC Filters: https://doi.org/10.1145/3339825.3394929
        GPAC: https://doi.org/10.1145/1291233.1291452

GPAC Configuration: --prefix=/usr/local/stow/gpac
Features: GPAC_CONFIG_LINUX GPAC_64_BITS GPAC_HAS_IPV6 GPAC_HAS_SSL GPAC_HAS_SOCK_UN GPAC_MINIMAL_ODF GPAC_HAS_QJS GPAC_HAS_JPEG GPAC_HAS_PNG GPAC_HAS_JP2 GPAC_HAS_THEORA GPAC_HAS_VORBIS GPAC_HAS_XVID GPAC_HAS_LINUX_DVB  GPAC_DISABLE_3D 
```

**EDIT**: Seems like it works if I use `zh-{cmn,yue}-{Hans,Hant,CN,TW}`.
Some BCP 47 language codes not recognized
This is a GitHub Issue
repo:gpac
owner:gpac
Title : Some BCP 47 language codes not recognized
Issue date:

--- start body ---
Thanks for reporting your issue. Please make sure these boxes are checked before submitting your issue - thank you!

- [x] I looked for a similar issue and couldn't find any.
- [x] I tried with the latest version of GPAC. Installers available at http://gpac.io/downloads/gpac-nightly-builds/
- [x] I give enough information for contributors to reproduce my issue (meaningful title, github labels, platform and compiler, command-line ...). I can share files anonymously with this dropbox: https://www.mediafire.com/filedrop/filedrop_hosted.php?drop=eec9e058a9486fe4e99c33021481d9e1826ca9dbc242a6cfaab0fe95da5e5d95

Detailed guidelines: http://gpac.io/2013/07/16/how-to-file-a-bug-properly/

---

Attempting to use BCP 47 language tags such as `{cmn,yue}-{Hans,Hant,CN,TW}` results in an error and files being tagged `und`. These should be recognized for `elng` and the old langauge element set to `chi` (since there wasn't support for `cmn`/`yue` in the old standard).

```
❯ mp4box -for-test -add 'magic.crystal.mp4#video' -add 'magic.crystal.mp4#audio:lang=yue:name=Cantonese' -add 'magic.crystal.yue-Hant.forced.srt:lang=yue-Hant:txtflags=0xC0000000:name=Cantonese (Traditional) (Forced)' -add 'magic.crystal.cmn-Hans.srt:lang=cmn-Hans:name=Mandarin (Simplified)' -add 'magic.crystal.cmn-Hant.srt:lang=cmn-Hant:name=Mandarin (Traditional)' -add 'magic.crystal.eng.srt:lang=en' -tmp ~/tmp/mp4box -brand mp42isom -ab dby1 -no-iod -enable 1 Magic.Crystal.1986.2160p.WEB-DL.AAC2.0.DV.HDR.H.265-ECLiPSE.mp4
IsoMedia import magic.crystal.mp4 - track ID 1 - Video (size 3840 x 2160)
IsoMedia import magic.crystal.mp4 - track ID 2 - Audio (SR 48000 - 2 channels)
Track Importing Timed Text - Text track 3840 x 2160 font Serif (size 18) layer 0
The given code is not a valid one: yue-Hant, using 'und' as 3-letter code
Track Importing Timed Text - Text track 3840 x 2160 font Serif (size 18) layer 0
The given code is not a valid one: cmn-Hans, using 'und' as 3-letter code
Track Importing Timed Text - Text track 3840 x 2160 font Serif (size 18) layer 0
The given code is not a valid one: cmn-Hant, using 'und' as 3-letter code
Track Importing Timed Text - Text track 3840 x 2160 font Serif (size 18) layer 0
0.500 secs Interleaving
```

```
❯ mp4box -version
MP4Box - GPAC version 2.1-DEV-rev223-ge4df874e7-master
(c) 2000-2022 Telecom Paris distributed under LGPL v2.1+ - http://gpac.io

Please cite our work in your research:
        GPAC Filters: https://doi.org/10.1145/3339825.3394929
        GPAC: https://doi.org/10.1145/1291233.1291452

GPAC Configuration: --prefix=/usr/local/stow/gpac
Features: GPAC_CONFIG_LINUX GPAC_64_BITS GPAC_HAS_IPV6 GPAC_HAS_SSL GPAC_HAS_SOCK_UN GPAC_MINIMAL_ODF GPAC_HAS_QJS GPAC_HAS_JPEG GPAC_HAS_PNG GPAC_HAS_JP2 GPAC_HAS_THEORA GPAC_HAS_VORBIS GPAC_HAS_XVID GPAC_HAS_LINUX_DVB  GPAC_DISABLE_3D 
```

**EDIT**: Seems like it works if I use `zh-{cmn,yue}-{Hans,Hant,CN,TW}`.
--- end body ---

The issue describes a problem with the GPAC library not recognizing certain BCP 47 language codes, specifically `{cmn,yue}-{Hans,Hant,CN,TW}`, resulting in files being tagged as `und` (undefined). This is a functionality issue rather than a security vulnerability, as it does not expose any security risks or allow for exploitation.