From: Raymond Hettinger Date: Tue, 6 Aug 2002 22:39:30 +0000 (+0000) Subject: Document handling of raw-unicode-escapes. Closes SF bug 587087. X-Git-Tag: v2.2.2b1~238 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9c8d4320e3017995021b531ed933e0a876de101e;p=thirdparty%2FPython%2Fcpython.git Document handling of raw-unicode-escapes. Closes SF bug 587087. --- diff --git a/Doc/ref/ref2.tex b/Doc/ref/ref2.tex index 887d204496be..c5e43f5448af 100644 --- a/Doc/ref/ref2.tex +++ b/Doc/ref/ref2.tex @@ -423,6 +423,14 @@ escape the following quote character). Note also that a single backslash followed by a newline is interpreted as those two characters as part of the string, \emph{not} as a line continuation. +When an `r' or `R' prefix is used in conjunction with a `u' or `U' +prefix, then the \uXXXX escape sequence is processed while \emph{all other +backslashes are left in the string}. For example, the string literal +\code{ur"\u0062\n"} consists of three Unicode characters: +`LATIN SMALL LETTER B', `REVERSE SOLIDUS', and `LATIN SMALL LETTER N'. +Backslashes can be escaped with a preceding backslash; however, both +remain in the string. As a result, \uXXXX escape sequences are +only recognized when there are an odd number of backslashes. \subsection{String literal concatenation\label{string-catenation}}