mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 03:44:55 +00:00 
			
		
		
		
	Fixed and extended the example; the original example contained some
bogus code.
This commit is contained in:
		
							parent
							
								
									0e13da904c
								
							
						
					
					
						commit
						d028ca989a
					
				
					 2 changed files with 12 additions and 6 deletions
				
			
		| 
						 | 
					@ -184,9 +184,12 @@ Example:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\begin{verbatim}
 | 
					\begin{verbatim}
 | 
				
			||||||
>>> import locale
 | 
					>>> import locale
 | 
				
			||||||
>>> locale.open(locale.LC_ALL,"de") #setting locale to German
 | 
					>>> loc = locale.setlocale(locale.LC_ALL) # get current locale
 | 
				
			||||||
>>> locale.strcoll("f\344n","foo")  #comparing a string containing an umlaut 
 | 
					>>> locale.setlocale(locale.LC_ALL, "de") # use German locale
 | 
				
			||||||
>>> can.close()
 | 
					>>> 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}
 | 
					\end{verbatim}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\subsection{Background, details, hints, tips and caveats}
 | 
					\subsection{Background, details, hints, tips and caveats}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -184,9 +184,12 @@ Example:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\begin{verbatim}
 | 
					\begin{verbatim}
 | 
				
			||||||
>>> import locale
 | 
					>>> import locale
 | 
				
			||||||
>>> locale.open(locale.LC_ALL,"de") #setting locale to German
 | 
					>>> loc = locale.setlocale(locale.LC_ALL) # get current locale
 | 
				
			||||||
>>> locale.strcoll("f\344n","foo")  #comparing a string containing an umlaut 
 | 
					>>> locale.setlocale(locale.LC_ALL, "de") # use German locale
 | 
				
			||||||
>>> can.close()
 | 
					>>> 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}
 | 
					\end{verbatim}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\subsection{Background, details, hints, tips and caveats}
 | 
					\subsection{Background, details, hints, tips and caveats}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue