Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vTRdm-001pGw-33 for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Dec 2025 21:22:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vTRdl-0012Y7-31 for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Dec 2025 21:22:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vTRdl-0012Xz-25 for pgsql-hackers@lists.postgresql.org; Wed, 10 Dec 2025 21:22:30 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vTRdk-0002m0-04 for pgsql-hackers@lists.postgresql.org; Wed, 10 Dec 2025 21:22:30 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 5BALMJbj698654; Wed, 10 Dec 2025 16:22:19 -0500 From: Tom Lane To: Nico Williams cc: Thomas Munro , pgsql-hackers@lists.postgresql.org Subject: Re: Solaris versus our NLS files In-reply-to: <308000.1765323379@sss.pgh.pa.us> References: <292844.1765315339@sss.pgh.pa.us> <308000.1765323379@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Tue, 09 Dec 2025 18:36:19 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <698652.1765401739.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Wed, 10 Dec 2025 16:22:19 -0500 Message-ID: <698653.1765401739@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I wrote: > Encoding-specific behaviors might be worth testing later, but > I'm not excited about that personally. Despite that disclaimer, I experimented with the questionable nb.po file on my OpenIndiana installation, and it seems to Just Work after creating the nb_NO.UTF-8 -> nb locale symlink: tgl@openindiana:~$ LANG=nb_NO.UTF-8 pg_config bogus pg_config: ugyldig argument: bogus Prøv «pg_config --help» for mer informasjon. "od -c" confirms that that output is UTF-8 encoded: tgl@openindiana:~$ LANG=nb_NO.UTF-8 pg_config bogus 2>&1 | od -c 0000000 p g _ c o n f i g : u g y l d 0000020 i g a r g u m e n t : b o g 0000040 u s \n P r 303 270 v 302 253 p g _ c o 0000060 n f i g - - h e l p 302 273 f o 0000100 r m e r i n f o r m a s j o 0000120 n . \n 0000123 I checked further, and found that nb.mo has been transcoded to UTF8! So this case didn't require any runtime transcoding anyway. It doesn't stop there though. I soon realized that configure had seized on GNU msgfmt not Sun's, and convert-to-UTF8 is the default behavior of GNU msgfmt. I then forced the build to use /usr/bin/msgfmt, and confirmed that now nb.mo remains in LATIN1. But I still get exactly the above output! So apparently, "Sun's gettext can't transcode" is obsolete information. It works fine in this setup, despite using symlinks that may not be telling the truth about the encoding of the .mo files. I also verified that I could get LATIN1 output from UTF-8 .mo files, so long as LANG is set to a name that "locale -a" admits the existence of and I add a matching symlink. So we don't actually have to confine our support for this to the UTF-8 locales. But I'm inclined to just do that much for now and wait to see if anyone complains. (I agree with Munro that that's likely to be never.) This also means that this project doesn't require adoption of a "UTF8-only" policy for our .po files. I'm inclined to think that such a policy might be a good idea anyway, but it's not forced by wanting to support Sun's gettext(). regards, tom lane