summaryrefslogtreecommitdiff
path: root/Doc/library/locale.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/library/locale.rst')
-rw-r--r--Doc/library/locale.rst9
1 files changed, 7 insertions, 2 deletions
diff --git a/Doc/library/locale.rst b/Doc/library/locale.rst
index 45aba0af0f..9600193547 100644
--- a/Doc/library/locale.rst
+++ b/Doc/library/locale.rst
@@ -55,6 +55,8 @@ The :mod:`locale` module defines the following exception and functions:
Returns the database of the local conventions as a dictionary. This dictionary
has the following strings as keys:
+ .. tabularcolumns:: |l|l|L|
+
+----------------------+-------------------------------------+--------------------------------+
| Category | Key | Meaning |
+======================+=====================================+================================+
@@ -475,8 +477,11 @@ in such a way that frequent locale changes may cause core dumps. This makes the
locale somewhat painful to use correctly.
Initially, when a program is started, the locale is the ``C`` locale, no matter
-what the user's preferred locale is. The program must explicitly say that it
-wants the user's preferred locale settings by calling ``setlocale(LC_ALL, '')``.
+what the user's preferred locale is. There is one exception: the
+:data:`LC_CTYPE` category is changed at startup to set the current locale
+encoding to the user's preferred locale encoding. The program must explicitly
+say that it wants the user's preferred locale settings for other categories by
+calling ``setlocale(LC_ALL, '')``.
It is generally a bad idea to call :func:`setlocale` in some library routine,
since as a side effect it affects the entire program. Saving and restoring it