pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Davis <pgsql@j-davis.com>
To: Alexander Korotkov <aekorotkov@gmail.com>
To: Oleg Tselebrovskiy <o.tselebrovskiy@postgrespro.ru>
Cc: pgsql-docs@lists.postgresql.org
Subject: Re: Initcap works differently with different locale providers
Date: Wed, 30 Jul 2025 12:58:50 -0700
Message-ID: <9247c1b9531136e15d83511270e8c43bf877c9ca.camel@j-davis.com> (raw)
In-Reply-To: <0658C8F0-5ED4-4962-A2A3-524B0D899982@gmail.com>
References: <804cc10ef95d4d3b298e76b181fd9437@postgrespro.ru>
	<0658C8F0-5ED4-4962-A2A3-524B0D899982@gmail.com>

On Mon, 2025-07-28 at 13:20 +0300, Alexander Korotkov wrote:
> I can confirm inicap works with libc and libicu as you stated.  The
> documentation patch looks good to me.  I’ve written a commit message.
>  The REL_12_STABLE branch is not relevant anymore as it’s out of
> support.  I’m going to push this if no objections.

Apologies for the late review.

First, it doesn't mention the "builtin" provider, which uses the same
word break rules as libc.

Second, word boundaries can be complex, and I'm wondering if we should
not be so precise about what ICU does or doesn't do. For instance, ICU
has options like U_TITLECASE_ADJUST_TO_CASED,
U_TITLECASE_NO_BREAK_ADJUSTMENT, etc.[1], and I'm not sure exactly
which one of those we use.

I'd prefer that we try to explain that INITCAP() is intended for
convenient display, and the specific result should not be relied upon
(at least for ICU; maybe for all providers). If you want specific word
boundary rules, write your own function.

Regards,
	Jeff Davis

[1]
https://unicode-org.github.io/icu-docs/apidoc/dev/icu4c/stringoptions_8h.html#a4975f537b9960f0330b23...






view thread (16+ messages)  latest in thread

Message-ID: <9247c1b9531136e15d83511270e8c43bf877c9ca.camel@j-davis.com>
Permalink:  ../9247c1b9531136e15d83511270e8c43bf877c9ca.camel@j-davis.com/
Also on:    postgresql.org/message-id/9247c1b9531136e15d83511270e8c43bf877c9ca.camel@j-davis.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: pgsql@j-davis.com, aekorotkov@gmail.com, o.tselebrovskiy@postgrespro.ru, pgsql-docs@lists.postgresql.org
  Subject: Re: Initcap works differently with different locale providers
  In-Reply-To: <9247c1b9531136e15d83511270e8c43bf877c9ca.camel@j-davis.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox