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
83283c27
Commit
83283c27
authored
Nov 16, 2010
by
Alexander Belopolsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #10413: Updated comments to reflect code changes
parent
8593ae64
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
18 deletions
+13
-18
Include/unicodeobject.h
Include/unicodeobject.h
+13
-18
No files found.
Include/unicodeobject.h
View file @
83283c27
...
@@ -7,7 +7,8 @@
...
@@ -7,7 +7,8 @@
Unicode implementation based on original code by Fredrik Lundh,
Unicode implementation based on original code by Fredrik Lundh,
modified by Marc-Andre Lemburg (mal@lemburg.com) according to the
modified by Marc-Andre Lemburg (mal@lemburg.com) according to the
Unicode Integration Proposal (see file Misc/unicode.txt).
Unicode Integration Proposal. (See
http://www.egenix.com/files/python/unicode-proposal.txt).
Copyright (c) Corporation for National Research Initiatives.
Copyright (c) Corporation for National Research Initiatives.
...
@@ -354,8 +355,8 @@ typedef PY_UNICODE_TYPE Py_UNICODE;
...
@@ -354,8 +355,8 @@ typedef PY_UNICODE_TYPE Py_UNICODE;
for (i_ = 0; i_ < (length); i_++) t_[i_] = v_;\
for (i_ = 0; i_ < (length); i_++) t_[i_] = v_;\
} while (0)
} while (0)
/* Check if substring matches at given offset.
t
he offset must be
/* Check if substring matches at given offset.
T
he offset must be
valid, and the substring must not be empty */
valid, and the substring must not be empty
.
*/
#define Py_UNICODE_MATCH(string, offset, substring) \
#define Py_UNICODE_MATCH(string, offset, substring) \
((*((string)->str + (offset)) == *((substring)->str)) && \
((*((string)->str + (offset)) == *((substring)->str)) && \
...
@@ -483,8 +484,8 @@ PyAPI_FUNC(int) PyUnicode_Resize(
...
@@ -483,8 +484,8 @@ PyAPI_FUNC(int) PyUnicode_Resize(
Coercion is done in the following way:
Coercion is done in the following way:
1. bytes, bytearray and other char buffer compatible objects are decoded
1. bytes, bytearray and other char buffer compatible objects are decoded
under the assumptions that they contain data using the
current
under the assumptions that they contain data using the
UTF-8
default
encoding. Decoding is done in "strict" mode.
encoding. Decoding is done in "strict" mode.
2. All other objects (including Unicode objects) raise an
2. All other objects (including Unicode objects) raise an
exception.
exception.
...
@@ -614,7 +615,7 @@ PyAPI_FUNC(int) PyUnicode_ClearFreeList(void);
...
@@ -614,7 +615,7 @@ PyAPI_FUNC(int) PyUnicode_ClearFreeList(void);
Many of these APIs take two arguments encoding and errors. These
Many of these APIs take two arguments encoding and errors. These
parameters encoding and errors have the same semantics as the ones
parameters encoding and errors have the same semantics as the ones
of the builtin
unicode
() API.
of the builtin
str
() API.
Setting encoding to NULL causes the default encoding (UTF-8) to be used.
Setting encoding to NULL causes the default encoding (UTF-8) to be used.
...
@@ -633,7 +634,8 @@ PyAPI_FUNC(int) PyUnicode_ClearFreeList(void);
...
@@ -633,7 +634,8 @@ PyAPI_FUNC(int) PyUnicode_ClearFreeList(void);
/* Return a Python string holding the default encoded value of the
/* Return a Python string holding the default encoded value of the
Unicode object.
Unicode object.
The resulting string is cached in the Unicode object for subsequent
Same as PyUnicode_AsUTF8String() except
the resulting string is cached in the Unicode object for subsequent
usage by this function. The cached version is needed to implement
usage by this function. The cached version is needed to implement
the character buffer interface and will live (at least) as long as
the character buffer interface and will live (at least) as long as
the Unicode object itself.
the Unicode object itself.
...
@@ -648,14 +650,14 @@ PyAPI_FUNC(PyObject *) _PyUnicode_AsDefaultEncodedString(
...
@@ -648,14 +650,14 @@ PyAPI_FUNC(PyObject *) _PyUnicode_AsDefaultEncodedString(
PyObject
*
unicode
,
PyObject
*
unicode
,
const
char
*
errors
);
const
char
*
errors
);
/* Returns a pointer to the default encoding (
normally,
UTF-8) of the
/* Returns a pointer to the default encoding (UTF-8) of the
Unicode object unicode and the size of the encoded representation
Unicode object unicode and the size of the encoded representation
in bytes stored in *size.
in bytes stored in *size.
In case of an error, no *size is set.
In case of an error, no *size is set.
*** This API is for interpreter INTERNAL USE ONLY and will likely
*** This API is for interpreter INTERNAL USE ONLY and will likely
*** be removed or changed
for Python 3.1
.
*** be removed or changed
in the future
.
*** If you need to access the Unicode object as UTF-8 bytes string,
*** If you need to access the Unicode object as UTF-8 bytes string,
*** please use PyUnicode_AsUTF8String() instead.
*** please use PyUnicode_AsUTF8String() instead.
...
@@ -666,7 +668,7 @@ PyAPI_FUNC(char *) _PyUnicode_AsStringAndSize(
...
@@ -666,7 +668,7 @@ PyAPI_FUNC(char *) _PyUnicode_AsStringAndSize(
PyObject
*
unicode
,
PyObject
*
unicode
,
Py_ssize_t
*
size
);
Py_ssize_t
*
size
);
/* Returns a pointer to the default encoding (
normally, UTf
-8) of the
/* Returns a pointer to the default encoding (
UTF
-8) of the
Unicode object unicode.
Unicode object unicode.
Use of this API is DEPRECATED since no size information can be
Use of this API is DEPRECATED since no size information can be
...
@@ -682,14 +684,7 @@ PyAPI_FUNC(char *) _PyUnicode_AsStringAndSize(
...
@@ -682,14 +684,7 @@ PyAPI_FUNC(char *) _PyUnicode_AsStringAndSize(
PyAPI_FUNC
(
char
*
)
_PyUnicode_AsString
(
PyObject
*
unicode
);
PyAPI_FUNC
(
char
*
)
_PyUnicode_AsString
(
PyObject
*
unicode
);
/* Returns the currently active default encoding.
/* Returns "utf-8". */
The default encoding is currently implemented as run-time settable
process global. This may change in future versions of the
interpreter to become a parameter which is managed on a per-thread
basis.
*/
PyAPI_FUNC
(
const
char
*
)
PyUnicode_GetDefaultEncoding
(
void
);
PyAPI_FUNC
(
const
char
*
)
PyUnicode_GetDefaultEncoding
(
void
);
...
...
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