Show '\011', '\012', and '\015' as '\t', '\n', '\r' in strings.
Switch from octal escapes to hex escapes for other nonprintable characters.
diff --git a/Doc/lib/liblinecache.tex b/Doc/lib/liblinecache.tex
index f491d4c..8a9b914 100644
--- a/Doc/lib/liblinecache.tex
+++ b/Doc/lib/liblinecache.tex
@@ -41,5 +41,5 @@
 \begin{verbatim}
 >>> import linecache
 >>> linecache.getline('/etc/passwd', 4)
-'sys:x:3:3:sys:/dev:/bin/sh\012'
+'sys:x:3:3:sys:/dev:/bin/sh\n'
 \end{verbatim}
diff --git a/Doc/lib/liblocale.tex b/Doc/lib/liblocale.tex
index 974d696..107c21d 100644
--- a/Doc/lib/liblocale.tex
+++ b/Doc/lib/liblocale.tex
@@ -265,7 +265,7 @@
 >>> 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
diff --git a/Doc/lib/libmd5.tex b/Doc/lib/libmd5.tex
index bec1132..f471bae 100644
--- a/Doc/lib/libmd5.tex
+++ b/Doc/lib/libmd5.tex
@@ -25,14 +25,14 @@
 >>> m.update("Nobody inspects")
 >>> m.update(" the spammish repetition")
 >>> m.digest()
-'\273d\234\203\335\036\245\311\331\336\311\241\215\360\377\351'
+'\xbbd\x9c\x83\xdd\x1e\xa5\xc9\xd9\xde\xc9\xa1\x8d\xf0\xff\xe9'
 \end{verbatim}
 
 More condensed:
 
 \begin{verbatim}
 >>> md5.new("Nobody inspects the spammish repetition").digest()
-'\273d\234\203\335\036\245\311\331\336\311\241\215\360\377\351'
+'\xbbd\x9c\x83\xdd\x1e\xa5\xc9\xd9\xde\xc9\xa1\x8d\xf0\xff\xe9'
 \end{verbatim}
 
 \begin{funcdesc}{new}{\optional{arg}}
diff --git a/Doc/lib/libparser.tex b/Doc/lib/libparser.tex
index 96256ad..9ff3f42 100644
--- a/Doc/lib/libparser.tex
+++ b/Doc/lib/libparser.tex
@@ -432,7 +432,7 @@
                (297,
                 (298,
                  (299,
-                  (300, (3, '"""Some documentation.\012"""'))))))))))))))))),
+                  (300, (3, '"""Some documentation.\n"""'))))))))))))))))),
    (4, ''))),
  (4, ''),
  (0, ''))
@@ -537,7 +537,7 @@
 >>> found
 1
 >>> vars
-{'docstring': '"""Some documentation.\012"""'}
+{'docstring': '"""Some documentation.\n"""'}
 \end{verbatim}
 
 Once specific data can be extracted from a location where it is
diff --git a/Doc/lib/libpyexpat.tex b/Doc/lib/libpyexpat.tex
index 27edc08..b50c52d 100644
--- a/Doc/lib/libpyexpat.tex
+++ b/Doc/lib/libpyexpat.tex
@@ -272,11 +272,11 @@
 Start element: child1 {'name': 'paul'}
 Character data: 'Text goes here'
 End element: child1
-Character data: '\012'
+Character data: '\n'
 Start element: child2 {'name': 'fred'}
 Character data: 'More text'
 End element: child2
-Character data: '\012'
+Character data: '\n'
 End element: parent
 \end{verbatim}
 
diff --git a/Doc/lib/librotor.tex b/Doc/lib/librotor.tex
index ba7c402..e1db8ef 100644
--- a/Doc/lib/librotor.tex
+++ b/Doc/lib/librotor.tex
@@ -68,17 +68,17 @@
 >>> import rotor
 >>> rt = rotor.newrotor('key', 12)
 >>> rt.encrypt('bar')
-'\2534\363'
+'\xab4\xf3'
 >>> rt.encryptmore('bar')
-'\357\375$'
+'\xef\xfd$'
 >>> rt.encrypt('bar')
-'\2534\363'
->>> rt.decrypt('\2534\363')
+'\xab4\xf3'
+>>> rt.decrypt('\xab4\xf3')
 'bar'
->>> rt.decryptmore('\357\375$')
+>>> rt.decryptmore('\xef\xfd$')
 'bar'
->>> rt.decrypt('\357\375$')
-'l(\315'
+>>> rt.decrypt('\xef\xfd$')
+'l(\xcd'
 >>> del rt
 \end{verbatim}
 
diff --git a/Doc/lib/libstruct.tex b/Doc/lib/libstruct.tex
index 434b433..637d3e6 100644
--- a/Doc/lib/libstruct.tex
+++ b/Doc/lib/libstruct.tex
@@ -168,8 +168,8 @@
 \begin{verbatim}
 >>> from struct import *
 >>> pack('hhl', 1, 2, 3)
-'\000\001\000\002\000\000\000\003'
->>> unpack('hhl', '\000\001\000\002\000\000\000\003')
+'\x00\x01\x00\x02\x00\x00\x00\x03'
+>>> unpack('hhl', '\x00\x01\x00\x02\x00\x00\x00\x03')
 (1, 2, 3)
 >>> calcsize('hhl')
 8
diff --git a/Doc/tut/tut.tex b/Doc/tut/tut.tex
index 86014a8..8a47b22 100644
--- a/Doc/tut/tut.tex
+++ b/Doc/tut/tut.tex
@@ -801,24 +801,24 @@
 other ways of creating Unicode strings on the basis of a known
 encoding. 
 
-The builtin \function{unicode()}\bifuncindex{unicode} provides access
+The built-in function \function{unicode()}\bifuncindex{unicode} provides access
 to all registered Unicode codecs (COders and DECoders). Some of the
 more well known encodings which these codecs can convert are
 \emph{Latin-1}, \emph{ASCII}, \emph{UTF-8} and \emph{UTF-16}. The latter two
-are variable length encodings which permit to store Unicode characters
-in 8 or 16 bits. Python uses UTF-8 as default encoding. This becomes
-noticeable when printing Unicode strings or writing them to files.
+are variable-length encodings which store Unicode characters
+in blocks of 8 or 16 bits. To print a Unicode string or write it to a file,
+you must convert it to a string with the \method{encode()} method.
 
 \begin{verbatim}
 >>> u"äöü"
 u'\344\366\374'
->>> str(u"äöü")
+>>> u"äöü".encode('UTF-8')
 '\303\244\303\266\303\274'
 \end{verbatim}
 
 If you have data in a specific encoding and want to produce a
 corresponding Unicode string from it, you can use the
-\function{unicode()} builtin with the encoding name as second
+\function{unicode()} function with the encoding name as second
 argument.
 
 \begin{verbatim}
@@ -826,14 +826,6 @@
 u'\344\366\374'
 \end{verbatim}
 
-To convert the Unicode string back into a string using the original
-encoding, the objects provide an \method{encode()} method.
-
-\begin{verbatim}
->>> u"äöü".encode('UTF-8')
-'\303\244\303\266\303\274'
-\end{verbatim}
-
 
 \subsection{Lists \label{lists}}