Re: Remaining dependency on setlocale()

Поиск
Список
Период
Сортировка
От Thomas Munro
Тема Re: Remaining dependency on setlocale()
Дата
Msg-id CA+hUKGLYcbnHBXhHk_OFwZ03LE+D=cAirm7TVN8fMhT9rgcTbA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Remaining dependency on setlocale()  (Jeff Davis <pgsql@j-davis.com>)
Ответы Re: Remaining dependency on setlocale()
Список pgsql-hackers
On Thu, Jul 10, 2025 at 10:52 AM Jeff Davis <pgsql@j-davis.com> wrote:
> The first problem -- how to affect the encoding of strings returned by
> strerror() on windows -- may be solvable as well. It looks like
> LC_MESSAGES is not supported at all on windows, so the only thing to be
> concerned about is the encoding, which is affected by LC_CTYPE. But
> windows doesn't offer uselocale() or strerror_l(). The only way seems
> to be to call _configthreadlocale(_ENABLE_PER_THREAD_LOCALE) and then
> setlocale(LC_CTYPE, datctype) right before strerror(), and switch it
> back to "C" right afterward. Comments welcome.

FWIW there is an example of that in src/port/pg_localeconv_r.c.



В списке pgsql-hackers по дате отправления: