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 1nCGcn-0007fR-Ba for pgsql-hackers@arkaria.postgresql.org; Tue, 25 Jan 2022 07:52:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nCGcF-0004h6-Qg for pgsql-hackers@arkaria.postgresql.org; Tue, 25 Jan 2022 07:51:47 +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 1nC6oU-0002Ez-1V for pgsql-hackers@lists.postgresql.org; Mon, 24 Jan 2022 21:23:46 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nC6oO-0001mw-PG for pgsql-hackers@lists.postgresql.org; Mon, 24 Jan 2022 21:23:45 +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 A71ED21C66A0; Tue, 25 Jan 2022 00:23:38 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1643059418; bh=cNDeohLPDrXgBjdqoN8TGFKLEoaVKqVS6+iJdE3plCM=; h=Date:To:Cc:From:Subject; b=bYv6PYkxd/rs+qS7e2TY4ryC2u+jxBf8BUPH2MGf32GhjA+JNie0rAls2yrPkkMLD pWZ1L8xs54nH34lg/yzyPaQrgfIWwcrW7IZ+xcDy3D5a6FppHsVCbrtOaE0PReX8zi irG33HbOiUQE45mviOU4ZYJKdVKhjIkgvI0hDqNM= Message-ID: <0050ec23-34d9-2765-9015-98c04f0e18ac@postgrespro.ru> Date: Tue, 25 Jan 2022 00:23:38 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Content-Language: en-US To: =?UTF-8?Q?Juan_Jos=c3=a9_Santamar=c3=ada_Flecha?= Cc: PostgreSQL Hackers From: Dmitry Koval Subject: Re: WIN32 pg_import_system_collations 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 -