Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
pygolang
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
Kirill Smelkov
pygolang
Commits
5bf08f8b
Commit
5bf08f8b
authored
Feb 19, 2025
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
golang_str: def -> cdef for UTF-8b decode/encode routines
We use them only privately and only from pyx files.
parent
0cc53fdd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
golang/_golang_str.pyx
golang/_golang_str.pyx
+2
-2
No files found.
golang/_golang_str.pyx
View file @
5bf08f8b
...
...
@@ -2065,7 +2065,7 @@ cdef (rune, int) _utf8_decode_rune(const byte[::1] s):
# _utf8_decode_surrogateescape mimics s.decode('utf-8', 'surrogateescape') from py3.
def
_utf8_decode_surrogateescape
(
const
byte
[::
1
]
s
):
# -> unicode
c
def
_utf8_decode_surrogateescape
(
const
byte
[::
1
]
s
):
# -> unicode
if
PY_MAJOR_VERSION
>=
3
:
if
len
(
s
)
==
0
:
return
u''
# avoid out-of-bounds slice access on &s[0]
...
...
@@ -2105,7 +2105,7 @@ def _utf8_decode_surrogateescape(const byte[::1] s): # -> unicode
# _utf8_encode_surrogateescape mimics s.encode('utf-8', 'surrogateescape') from py3.
def
_utf8_encode_surrogateescape
(
s
):
# -> bytes
c
def
_utf8_encode_surrogateescape
(
s
):
# -> bytes
assert
isinstance
(
s
,
unicode
)
if
PY_MAJOR_VERSION
>=
3
:
return
zunicode
.
encode
(
s
,
'UTF-8'
,
'surrogateescape'
)
...
...
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