TTS crashes when a Windows voice reports multiple languages

The Ana Windows voice from CereProc reports to Windows that it supports both es_MX and es_US languages. Anki’s TTS field replacement logic crashes when it queries the voice’s language support – it expects one language code, not two. AwesomeTTS has always worked fine with the problematic voice for batch generation. Uninstalling the problematic voice from Windows prevents Anki’s TTS logic from crashing but of course then the voice can’t be used. For this problematic voice at least, a potential fix would be to use just one of the codes; either is fine.

An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site.
Debug info:
Anki 2.1.49 (dc80804a) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=3
Add-ons, last update check: 2022-01-14 14:25:48

Caught exception:
Traceback (most recent call last):
  File "aqt\", line 41, in cmd
  File "aqt\", line 142, in _onCmd
  File "aqt\", line 595, in _onBridgeCmd
  File "aqt\", line 91, in _linkHandler
  File "aqt\", line 672, in moveToState
  File "aqt\", line 694, in _reviewState
  File "aqt\", line 141, in show
  File "aqt\", line 161, in refresh_if_needed
  File "aqt\", line 211, in nextCard
  File "aqt\", line 321, in _showQuestion
  File "aqt\", line 153, in play_tags
  File "aqt\", line 204, in _play_next_if_idle
  File "aqt\", line 207, in _play
  File "aqt\", line 218, in _best_player_for_tag
  File "aqt\", line 110, in rank_for_tag
  File "aqt\", line 75, in voice_for_tag
  File "aqt\", line 71, in voices
  File "aqt\", line 489, in get_available_voices
  File "aqt\", line 493, in _voice_to_object
  File "aqt\", line 476, in lcid_hex_str_to_lang_code
ValueError: invalid literal for int() with base 16: '80a;540a'

0x80a =2,048 = “es_MX”
0x540a = 21,514 = “es_US”


P.S. To post this bug I couldn’t create a forum account using my hotmail email – the confirmation email never gets through (yes, I checked the spam folder, tried multiple times, and waited a day). With a gmail account the confirmation email came through instantly. Oddly, email to my hotmail account from (as for email address verification) makes it, no problem.

Thanks, added to the todo list.