Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nCGhH-0007mP-Nn for pgsql-hackers@arkaria.postgresql.org; Tue, 25 Jan 2022 07:56:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nCGhG-0001UI-Ks for pgsql-hackers@arkaria.postgresql.org; Tue, 25 Jan 2022 07:56:58 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nCGhG-0001U3-C3 for pgsql-hackers@lists.postgresql.org; Tue, 25 Jan 2022 07:56:58 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nCGhE-0006kK-0o for pgsql-hackers@lists.postgresql.org; Tue, 25 Jan 2022 07:56:57 +0000 Received: from [192.168.28.32] (cyclops.postgrespro.ru [93.174.131.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id B317D21C8B23; Tue, 25 Jan 2022 10:56:53 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1643097414; bh=cNDeohLPDrXgBjdqoN8TGFKLEoaVKqVS6+iJdE3plCM=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=L+PB5RUZx4GcAmqCc1Il8pLXMiwjFwIBu2kdazWuK8VuEzhwPOvkTiMpOVOIbfKTu /va6wSmuQxTfyPohjWImLc8H2kTDJX66P1r3xCNj6I5vI16XevayXV7YF+gwqdgG/5 zKZPDILrXZHxQchkgozqLAcUK/l6NF4UWGYzhzyA= Message-ID: Date: Tue, 25 Jan 2022 10:56:53 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: WIN32 pg_import_system_collations Content-Language: en-US To: =?UTF-8?Q?Juan_Jos=c3=a9_Santamar=c3=ada_Flecha?= Cc: PostgreSQL Hackers References: <20220119095312.b5ya3fvmmklnopmb@jrouhaud> From: Dmitry Koval In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Juan José, I a bit tested this feature and have small doubts about block: +/* + * Windows will use hyphens between language and territory, where POSIX + * uses an underscore. Simply make it POSIX looking. + */ + hyphen = strchr(localebuf, '-'); + if (hyphen) + *hyphen = '_'; After this block modified collation name is used in function GetNLSVersionEx(COMPARE_STRING, wide_collcollate, &version) (see win32_read_locale() -> CollationFromLocale() -> CollationCreate() call). Is it correct to use (wide_collcollate = "en_NZ") instead of (wide_collcollate = "en-NZ") in GetNLSVersionEx() function? 1) Documentation [1], [2], quote: If it is a neutral locale for which the script is significant, the pattern is -