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
22168998
Commit
22168998
authored
13 years ago
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
charmap encoders uses Py_UCS4, not Py_UNICODE
parent
54e26c01
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
Objects/unicodeobject.c
Objects/unicodeobject.c
+4
-7
No files found.
Objects/unicodeobject.c
View file @
22168998
...
...
@@ -7934,7 +7934,7 @@ PyUnicode_BuildEncodingMap(PyObject* string)
}
static
int
encoding_map_lookup
(
Py_U
NICODE
c
,
PyObject
*
mapping
)
encoding_map_lookup
(
Py_U
CS4
c
,
PyObject
*
mapping
)
{
struct
encoding_map
*
map
=
(
struct
encoding_map
*
)
mapping
;
int
l1
=
c
>>
11
;
...
...
@@ -7942,11 +7942,8 @@ encoding_map_lookup(Py_UNICODE c, PyObject *mapping)
int
l3
=
c
&
0x7F
;
int
i
;
#ifdef Py_UNICODE_WIDE
if
(
c
>
0xFFFF
)
{
if
(
c
>
0xFFFF
)
return
-
1
;
}
#endif
if
(
c
==
0
)
return
0
;
/* level 1*/
...
...
@@ -7971,7 +7968,7 @@ encoding_map_lookup(Py_UNICODE c, PyObject *mapping)
can't be found, Py_None is returned (or NULL, if another
error occurred). */
static
PyObject
*
charmapencode_lookup
(
Py_U
NICODE
c
,
PyObject
*
mapping
)
charmapencode_lookup
(
Py_U
CS4
c
,
PyObject
*
mapping
)
{
PyObject
*
w
=
PyLong_FromLong
((
long
)
c
);
PyObject
*
x
;
...
...
@@ -8036,7 +8033,7 @@ typedef enum charmapencode_result {
(in which case no character was written) or NULL, if a
reallocation error occurred. The caller must decref the result */
static
charmapencode_result
charmapencode_output
(
Py_U
NICODE
c
,
PyObject
*
mapping
,
charmapencode_output
(
Py_U
CS4
c
,
PyObject
*
mapping
,
PyObject
**
outobj
,
Py_ssize_t
*
outpos
)
{
PyObject
*
rep
;
...
...
This diff is collapsed.
Click to expand it.
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