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
Gwenaël Samain
cython
Commits
015b5ef0
Commit
015b5ef0
authored
Jul 03, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix parsing of wide unicode escapes on narrow Unicode platforms
parent
846d1859
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
Cython/Compiler/StringEncoding.py
Cython/Compiler/StringEncoding.py
+13
-2
No files found.
Cython/Compiler/StringEncoding.py
View file @
015b5ef0
...
@@ -30,6 +30,17 @@ class UnicodeLiteralBuilder(object):
...
@@ -30,6 +30,17 @@ class UnicodeLiteralBuilder(object):
assert
isinstance
(
characters
,
_unicode
),
str
(
type
(
characters
))
assert
isinstance
(
characters
,
_unicode
),
str
(
type
(
characters
))
self
.
chars
.
append
(
characters
)
self
.
chars
.
append
(
characters
)
if
sys
.
maxunicode
==
65535
:
def
append_charval
(
self
,
char_number
):
if
char_number
>
65535
:
# wide Unicode character on narrow platform => replace
# by surrogate pair
char_number
-=
0x10000
self
.
chars
.
append
(
unichr
((
char_number
%
1024
)
+
0xDC00
)
)
self
.
chars
.
append
(
unichr
((
char_number
//
1024
)
+
0xD800
)
)
else
:
self
.
chars
.
append
(
unichr
(
char_number
)
)
else
:
def
append_charval
(
self
,
char_number
):
def
append_charval
(
self
,
char_number
):
self
.
chars
.
append
(
unichr
(
char_number
)
)
self
.
chars
.
append
(
unichr
(
char_number
)
)
...
...
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