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:
Ka-Ping Yee 2001-01-24 17:19:08 +00:00
parent 726b78ecb8
commit fa004ad36c
13 changed files with 221 additions and 205 deletions

View file

@ -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