[Python-checkins] CVS: python/dist/src/Doc/lib libfuncs.tex,1.61,1.62

Fred Drake python-dev@python.org
Thu, 6 Apr 2000 10:43:14 -0400


Update of /projects/cvsroot/python/dist/src/Doc/lib
In directory seahag.cnri.reston.va.us:/home/fdrake/projects/python/Doc/lib

Modified Files:
	libfuncs.tex 
Log Message:

Marc-Andre Lemburg <mal@lemburg.com>:
Documentation for unichr(), unicode(), update for ord().


Index: libfuncs.tex
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Doc/lib/libfuncs.tex,v
retrieving revision 1.61
retrieving revision 1.62
diff -C2 -r1.61 -r1.62
*** libfuncs.tex	2000/02/17 17:45:52	1.61
--- libfuncs.tex	2000/04/06 14:43:12	1.62
***************
*** 467,473 ****
  
  \begin{funcdesc}{ord}{c}
!   Return the \ASCII{} value of a string of one character.  E.g.,
!   \code{ord('a')} returns the integer \code{97}.  This is the inverse of
!   \function{chr()}.
  \end{funcdesc}
  
--- 467,475 ----
  
  \begin{funcdesc}{ord}{c}
!   Return the \ASCII{} value of a string of one character or a Unicode
!   character.  E.g., \code{ord('a')} returns the integer \code{97},
!   \code{ord(u'\\u2020')} returns \code{8224}.  This is the inverse of
!   \function{chr()} for strings and of \function{unichr()} for Unicode
!   characters.
  \end{funcdesc}
  
***************
*** 659,662 ****
--- 661,679 ----
  >>> if type(x) == types.StringType: print "It's a string"
  \end{verbatim}
+ \end{funcdesc}
+ 
+ \begin{funcdesc}{unichr}{i}
+ Return the Unicode string of one character whose Unicode code is the
+ integer \var{i}, e.g., \code{unichr(97)} returns the string
+ \code{u'a'}.  This is the inverse of \function{ord()} for Unicode
+ strings.  The argument must be in the range [0..65535], inclusive.
+ \exception{ValueError} is raised otherwise.
+ \end{funcdesc}
+ 
+ \begin{funcdesc}{unicode}{string\optional{, encoding='utf-8'\optional{, errors='strict'}}}
+ Decodes \var{string} using the codec for \var{encoding}.  Error
+ handling is done according to \var{errors}.  The default behavior is
+ to decode UTF-8 in strict mode, meaning that encoding errors raise
+ \exception{ValueError}.
  \end{funcdesc}