doc: Mention how to obtain UTF-8 locales.
authorBruno Haible <bruno@clisp.org>
Sun, 1 Sep 2024 09:21:43 +0000 (11:21 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 1 Sep 2024 09:21:43 +0000 (11:21 +0200)
* doc/posix-functions/setlocale.texi: Mention the names of UTF-8 locales
and the needed compiler flags.

ChangeLog
doc/posix-functions/setlocale.texi

index 9ae76f3f8308c92ac98fa7551042a00e6d462c97..b0a5e5b7fa8c1d0cdbd9f0a41b9fe557e3cd0ba5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-09-01  Bruno Haible  <bruno@clisp.org>
+
+       doc: Mention how to obtain UTF-8 locales.
+       * doc/posix-functions/setlocale.texi: Mention the names of UTF-8 locales
+       and the needed compiler flags.
+
 2024-08-31  Collin Funk  <collin.funk1@gmail.com>
 
        doc: Fix typo.
index 6b5af76c10165a997a29f2898d46a95af889a5ad..e46c905a3d7c3817585350d176ca655de00c5c4f 100644 (file)
@@ -59,3 +59,24 @@ On Android 5.0 and newer, the default locale (i.e.@: the locale in use when
 the @code{"C"} or @code{"POSIX"} locale actually sets an equivalent of the
 @code{"C.UTF-8"} locale.
 @end itemize
+
+Note: The names of locales with UTF-8 encoding are platform dependent:
+@itemize
+@item
+On most platforms, they follow the naming scheme @samp{@var{ll}_@var{CC}.UTF-8}.
+Here @samp{@var{ll}} is an @w{ISO 639} two-letter language code,
+and @samp{@var{CC}} is an @w{ISO 3166} two-letter country code.
+For example, @samp{en_US.UTF-8} (this locale exists on nearly all systems),
+@samp{fr_FR.UTF-8}, and similar.
+@item
+On native Windows with mingw, UTF-8 locales are not supported.
+@item
+On native Windows with MSVC (version 14 or newer,
+and with the @code{-MD} option in @code{CFLAGS}),
+they follow the naming scheme @samp{@var{language}_@var{country}.65001}
+or, equivalently, @samp{@var{language}_@var{country}.utf8},
+where @samp{@var{language}} is a language name in English
+and @samp{@var{country}} is a country name in English.
+For example @samp{English_United States.65001} (yes, with a space in it!)
+or @samp{French_France.65001}.
+@end itemize