From 2b573a89c169bb15519454c2d72b90ec1c63c918 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 1 Sep 2024 11:21:43 +0200 Subject: [PATCH] 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. --- ChangeLog | 6 ++++++ doc/posix-functions/setlocale.texi | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/ChangeLog b/ChangeLog index 9ae76f3f83..b0a5e5b7fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2024-09-01 Bruno Haible + + 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 doc: Fix typo. diff --git a/doc/posix-functions/setlocale.texi b/doc/posix-functions/setlocale.texi index 6b5af76c10..e46c905a3d 100644 --- a/doc/posix-functions/setlocale.texi +++ b/doc/posix-functions/setlocale.texi @@ -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 -- 2.39.5