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
060472a8
Commit
060472a8
authored
Nov 07, 2011
by
Vitja Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add encoding prefix to string identifier, ticket #770
parent
c7919539
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
Cython/Compiler/Code.py
Cython/Compiler/Code.py
+8
-1
tests/run/file_encoding_T740.py
tests/run/file_encoding_T740.py
+9
-0
No files found.
Cython/Compiler/Code.py
View file @
060472a8
...
...
@@ -644,9 +644,16 @@ class StringConst(object):
prefix = Naming.interned_str_prefix
else:
prefix = Naming.py_const_prefix
pystring_cname = "
%
s
%
s_
%
s
" % (
if encoding_key:
encoding_prefix = '_%s' % encoding_key
else:
encoding_prefix = ''
pystring_cname = "
%
s
%
s
%
s_
%
s
" % (
prefix,
(is_str and 's') or (is_unicode and 'u') or 'b',
encoding_prefix,
self.cname[len(Naming.const_prefix):])
py_string = PyStringConst(
...
...
tests/run/file_encoding_T740.py
0 → 100644
View file @
060472a8
# encoding: koi8-r
# mode: run
# ticket: 740
"""
>>> wtf
'wtf'
"""
wtf
=
'wtf'
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