Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-10]: src/lib/libc/locale Pull up following revision(s) (requested...



details:   https://anonhg.NetBSD.org/src/rev/7db06ca4f4e4
branches:  netbsd-10
changeset: 372898:7db06ca4f4e4
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Jan 03 18:24:53 2023 +0000

description:
Pull up following revision(s) (requested by nia in ticket #33):

        lib/libc/locale/setlocale.3: revision 1.23

setlocale.3: Reflect state of NetBSD locale support in the 21st century

Don't use LC_COLLATE in a real code example, since a real call to set
LC_COLLATE will fail. Mention this.

Inconsistencies noticed by khw on IRC.

diffstat:

 lib/libc/locale/setlocale.3 |  24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diffs (65 lines):

diff -r 75dd2f819eea -r 7db06ca4f4e4 lib/libc/locale/setlocale.3
--- a/lib/libc/locale/setlocale.3       Tue Jan 03 18:23:18 2023 +0000
+++ b/lib/libc/locale/setlocale.3       Tue Jan 03 18:24:53 2023 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: setlocale.3,v 1.22 2021/10/24 17:30:19 gutteridge Exp $
+.\"    $NetBSD: setlocale.3,v 1.22.2.1 2023/01/03 18:24:53 martin Exp $
 .\"
 .\" Copyright (c) 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -32,7 +32,7 @@
 .\"
 .\"    @(#)setlocale.3 8.1 (Berkeley) 6/9/93
 .\"
-.Dd October 24, 2021
+.Dd December 31, 2022
 .Dt SETLOCALE 3
 .Os
 .Sh NAME
@@ -314,6 +314,14 @@
 .Fn setlocale
 or
 .Fn localeconv .
+.Pp
+Currently,
+.Fn setlocale
+returns
+.Dv NULL
+and fails to change the locale when
+.Dv LC_COLLATE
+is modified independently of other values.
 .Sh EXAMPLES
 The following code illustrates how a program can initialize the
 international environment for one language, while selectively
@@ -322,7 +330,7 @@
 language:
 .Bd -literal
        setlocale(LC_ALL, "de");
-       setlocale(LC_COLLATE, "fr");
+       setlocale(LC_NUMERIC, "C");
 .Ed
 .Pp
 When a process is started, its current locale is set to the C or POSIX
@@ -379,21 +387,13 @@
 functions first appeared in
 .Bx 4.4 .
 .Sh BUGS
-The current implementation supports only the
-.Li "\&""C""
-and
-.Li "\&""POSIX""
-locales for all but the
-.Dv LC_CTYPE
-locale.
-.Pp
 In spite of the gnarly currency support in
 .Fn localeconv ,
 the standards don't include any functions
 for generalized currency formatting.
 .Pp
 .Dv LC_COLLATE
-does not make sense for many languages.
+is unimplemented (but does not make sense for many languages).
 Use of
 .Dv LC_MONETARY
 could lead to misleading results until we have a real time currency



Home | Main Index | Thread Index | Old Index