Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
cython
Commits
08342a2d
Commit
08342a2d
authored
Mar 07, 2013
by
Nikita Nemkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass-through single surrogates in Py_UNICODE[] literal encoding routine.
parent
2e3cf3da
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
Cython/Compiler/StringEncoding.py
Cython/Compiler/StringEncoding.py
+3
-3
No files found.
Cython/Compiler/StringEncoding.py
View file @
08342a2d
...
...
@@ -280,9 +280,9 @@ def encode_pyunicode_string(s):
else
:
utf16
,
utf32
=
s
,
[]
for
code_unit
in
s
:
if
0xDC00
<=
code_unit
<=
0xDFFF
:
# low surrogate
high
,
low
=
utf32
.
pop
()
,
code_unit
utf32
.
append
(((
high
&
0x3FF
)
<<
10
)
+
(
low
&
0x3FF
)
+
0x10000
)
if
0xDC00
<=
code_unit
<=
0xDFFF
and
utf32
and
0xD800
<=
utf32
[
-
1
]
<=
0xDBFF
:
high
,
low
=
utf32
[
-
1
]
,
code_unit
utf32
[
-
1
]
=
((
high
&
0x3FF
)
<<
10
)
+
(
low
&
0x3FF
)
+
0x10000
else
:
utf32
.
append
(
code_unit
)
...
...
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