model-writtenrun 8671 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tom Lane opened the discussion in #1 because GetLocaleInfoEx() rejects some locale strings accepted by setlocale(), causing misleading encoding errors, and asked whether newer Visual Studio versions permitted replacing the workaround.
- Juan José SantamarÃa Flecha reported that the underlying limitation persisted in VS2019 and supplied #2, mapping CP_ACP to UTF-8 and preserving encoding names instead of always prefixing them with CP.
- Tom Lane explained that the fix also supports Unix-style encoding names and posted #3, strengthening the numeric-suffix check and clarifying the comments while retaining Juan's approach.
- Juan confirmed that the revised patch worked for the issue in #4, and Michael Paquier agreed in #5 while confirming that newer Visual Studio versions still lacked lc_codepage.
- Tom Lane committed #3 unchanged as 8c49454caa, with backports to all supported branches, and announced completion in #6; the fix retained GetLocaleInfoEx() while improving its result handling and fallback.