mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Show '\011', '\012', and '\015' as '\t', '\n', '\r' in strings.
Switch from octal escapes to hex escapes for other nonprintable characters.
This commit is contained in:
parent
726b78ecb8
commit
fa004ad36c
13 changed files with 221 additions and 205 deletions
|
@ -265,7 +265,7 @@ Example:
|
|||
>>> import locale
|
||||
>>> 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.strcoll('f\xe4n', '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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue