From 5204faf8187f9c9c52ed6d7e0417422a6cfa78db Mon Sep 17 00:00:00 2001
From: Alexander Korotkov <akorotkov@postgresql.org>
Date: Mon, 18 Aug 2025 00:40:05 +0300
Subject: [PATCH v4] Further clarify documentation for the initcap function

 * Document that title case is used for digraphs
 * Reference particular ICU function used
 * Add note about purpose of the function
---
 doc/src/sgml/func/func-string.sgml | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/doc/src/sgml/func/func-string.sgml b/doc/src/sgml/func/func-string.sgml
index 3eec93eb339..022b9f3c4cf 100644
--- a/doc/src/sgml/func/func-string.sgml
+++ b/doc/src/sgml/func/func-string.sgml
@@ -693,12 +693,19 @@
         <returnvalue>text</returnvalue>
        </para>
        <para>
-        Converts the first letter of each word to upper case and the
-        rest to lower case. When using the <literal>libc</literal> locale
-        provider, words are sequences of alphanumeric characters separated
-        by non-alphanumeric characters; when using the ICU locale provider,
-        words are separated according to
-        <ulink url="https://www.unicode.org/reports/tr29/#Word_Boundaries">Unicode Standard Annex #29</ulink>.
+        Converts the first letter of each word to upper case (or title case
+        if the letter is a digraph) and the rest to lower case. When using
+        the <literal>libc</literal> or <literal>builtin</literal> locale
+        provider, words are sequences of alphanumeric characters separated by non-alphanumeric characters;
+        when using the ICU locale provider, words are separated according to
+        <ulink url="https://unicode-org.github.io/icu-docs/apidoc/dev/icu4c/ustring_8h.html#a47602e2c2012d77ee91908b9bbfdc063">u_strToTitle ICU function</ulink>.
+       </para>
+       <para>
+        This function is primarily used for convenient
+        display, and the specific result should not be relied upon because of
+        the differences between locale providers and between different
+        ICU versions. If specific word boundary rules are desired,
+        it is recommended to write a custom function.
        </para>
        <para>
         <literal>initcap('hi THOMAS')</literal>
-- 
2.39.5 (Apple Git-154)

