pkgsrc-Users archive

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

Re: postgresql encoding/locale issues



wiz%NetBSD.org@localhost (Thomas Klausner) writes:

>** (transmission-gtk:13028): WARNING **: 12:18:09.572: Can't make the global C++ locale equal to the C locale.
>   locale::facet::_S_create_c_locale name not valid
>   C locale = C/de_AT.UTF-8/C/C/de_AT.UTF-8/C

>What's that warning about and what can do we better here?


Looks like our newlocale() is broken (has always been broken).

Index: newlocale.c
===================================================================
RCS file: /cvsroot/src/lib/libc/locale/newlocale.c,v
retrieving revision 1.3
diff -p -u -r1.3 newlocale.c
--- newlocale.c 13 Sep 2013 13:13:32 -0000      1.3
+++ newlocale.c 16 Apr 2023 19:13:26 -0000
@@ -77,6 +77,7 @@ newlocale(int mask, const char *name, lo
                }
                if (howmany-- > 0) {
                        for (i = 1; i < howmany; ++i) {
+                               *tail++ = '\0';
                                tokens[i] = (const char *)tail;
                                tail = strchr(tokens[i], '/');
                                if (tail == NULL) {
@@ -84,6 +85,7 @@ newlocale(int mask, const char *name, lo
                                        return NULL;
                                }
                        }
+                       *tail++ = '\0';
                        tokens[howmany] = tail;
                        tail = strchr(tokens[howmany], '/');
                        if (tail != NULL) {




Home | Main Index | Thread Index | Old Index