Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
c0dac1a5
Commit
c0dac1a5
authored
May 15, 2001
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Beef up the unicode() description a bit, based on material from AMK's
"What's New in Python ..." documents.
parent
da05e977
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
Doc/lib/libfuncs.tex
Doc/lib/libfuncs.tex
+12
-4
No files found.
Doc/lib/libfuncs.tex
View file @
c0dac1a5
...
...
@@ -688,10 +688,18 @@ strings. The argument must be in the range [0..65535], inclusive.
\end{funcdesc}
\begin{funcdesc}
{
unicode
}{
string
\optional
{
, encoding
\optional
{
, errors
}}}
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
}
. See also the
\refmodule
{
codecs
}
module.
Create a Unicode string from an 8-bit string
\var
{
string
}
using the
codec for
\var
{
encoding
}
. The
\var
{
encoding
}
parameter is a string
giving the name of an encoding. Error handling is done according to
\var
{
errors
}
; this specifies the treatment of characters which are
invalid in the input encoding. If
\var
{
errors
}
is
\code
{
'strict'
}
(the default), a
\exception
{
ValueError
}
is raised on errors, while a
value of
\code
{
'ignore'
}
causes errors to be silently ignored, and a
value of
\code
{
'replace'
}
causes the official Unicode replacement
character,
\code
{
U+FFFD
}
, to be used to replace input characters which
cannot be decoded. The default behavior is to decode UTF-8 in strict
mode, meaning that encoding errors raise
\exception
{
ValueError
}
. See
also the
\refmodule
{
codecs
}
module.
\versionadded
{
2.0
}
\end{funcdesc}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment