According to Microsoft’s documentation Windows has used IETF BCP locale names since Vista (in other words, they should be used on all currently-supported versions of Windows). These names typically look like “en-US” or “fr-FR”.
When on Windows 10 I install Python 3.13.1 from python.org, I get the following when I start it in cmd.exe
:
<code>>>> import locale
>>> locale.setlocale(locale.LC_ALL, "")
'French_France.1252'
</code>
<code>>>> import locale
>>> locale.setlocale(locale.LC_ALL, "")
'French_France.1252'
</code>
>>> import locale
>>> locale.setlocale(locale.LC_ALL, "")
'French_France.1252'
Putting aside for a moment the 8-bit codepage, where does French_France
come from? I can’t find this documented anywhere! And how can I convert it to a BCP-47 name?