From: Guido van Rossum Date: Sun, 22 Feb 1998 04:41:51 +0000 (+0000) Subject: Fixed and extended the example; the original example contained some X-Git-Tag: v1.5.1~603 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d028ca989a17321a976087aca78e0091c337800b;p=python Fixed and extended the example; the original example contained some bogus code. --- diff --git a/Doc/lib/liblocale.tex b/Doc/lib/liblocale.tex index c4c5506569..6425797d43 100644 --- a/Doc/lib/liblocale.tex +++ b/Doc/lib/liblocale.tex @@ -184,9 +184,12 @@ Example: \begin{verbatim} >>> import locale ->>> locale.open(locale.LC_ALL,"de") #setting locale to German ->>> locale.strcoll("f\344n","foo") #comparing a string containing an umlaut ->>> can.close() +>>> loc = locale.setlocale(locale.LC_ALL) # get current locale +>>> locale.setlocale(locale.LC_ALL, "de") # use German locale +>>> locale.strcoll("f\344n", "foo") # compare a string containing an umlaut +>>> locale.setlocale(locale.LC_ALL, "") # use user's preferred locale +>>> locale.setlocale(locale.LC_ALL, "C") # use default (C) locale +>>> locale.setlocale(locale.LC_ALL, loc) # restore saved locale \end{verbatim} \subsection{Background, details, hints, tips and caveats} diff --git a/Doc/liblocale.tex b/Doc/liblocale.tex index c4c5506569..6425797d43 100644 --- a/Doc/liblocale.tex +++ b/Doc/liblocale.tex @@ -184,9 +184,12 @@ Example: \begin{verbatim} >>> import locale ->>> locale.open(locale.LC_ALL,"de") #setting locale to German ->>> locale.strcoll("f\344n","foo") #comparing a string containing an umlaut ->>> can.close() +>>> loc = locale.setlocale(locale.LC_ALL) # get current locale +>>> locale.setlocale(locale.LC_ALL, "de") # use German locale +>>> locale.strcoll("f\344n", "foo") # compare a string containing an umlaut +>>> locale.setlocale(locale.LC_ALL, "") # use user's preferred locale +>>> locale.setlocale(locale.LC_ALL, "C") # use default (C) locale +>>> locale.setlocale(locale.LC_ALL, loc) # restore saved locale \end{verbatim} \subsection{Background, details, hints, tips and caveats}