From 5ac0e2ba902c1b6b93c792dc8ef2f608045b6800 Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?= Date: Thu, 14 Jan 2016 10:04:58 +0000 Subject: [PATCH] doc: mention setlocale() issues on OpenBSD * doc/posix-functions/setlocale.texi: Mention setlocale(LC_ALL,"") never fails, and the need to check categories individually. --- ChangeLog | 6 ++++++ doc/posix-functions/setlocale.texi | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog index b19edb1e26..27de5886c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2016-01-14 Pádraig Brady + + doc: mention setlocale() issues on OpenBSD + * doc/posix-functions/setlocale.texi: Mention setlocale(LC_ALL,"") + never fails, and the need to check categories individually. + 2016-01-14 Pádraig Brady sig2str: list all signals on FreeBSD >= 7 diff --git a/doc/posix-functions/setlocale.texi b/doc/posix-functions/setlocale.texi index ee4d477906..1da6d13396 100644 --- a/doc/posix-functions/setlocale.texi +++ b/doc/posix-functions/setlocale.texi @@ -29,4 +29,12 @@ On Cygwin 1.5.x, which doesn't have locales, @code{setlocale(LC_ALL,NULL)} always returns @code{"C"}. @item On Cygwin 1.7.0, only the charset portion of a locale designation is honored. +@item +On OpenBSD, @code{setlocale(LC_ALL,"")} will only update categories that +are deemed appropriate for the @code{LC_ALL} environment value, even if +there are other categories set to different values in the environment. +In addition any value is accepted for @code{LC_CTYPE}, and so NULL +is never returned to indicate a failure to set locale. +To verify category values, each category must be set individually +with @code{setlocale(LC_COLLATE,"")} etc. @end itemize -- 2.39.5