1 Dec 2009 04:09
Re: [Cython] Another string encoding idea
Just to clarify discussion, here is what I'm proposing (which is still
in flux, and simplified due to memory issues, which does make it less
attractive as one does not get to choose the used encoding, but it
would always be UTF-8 in Py3).
Without directive(s) (as it is now):
char* <-> bytes
With the directive(s) (which can be applied locally or globally):
char* <-> str
unicode/bytes -> char* would also work (for Py2/Py3 respectively)
The encoding used would be the system default (in Py2) and UTF-8 (in
Py3). This would use the defenc slot so the encoded char* would be
valid as long as the unicode object is around, and the long term
future of the defenc slot needs to be ensured before this could be
used for non-arguments conversion.
Also out there is the idea of a directive that would make char* become
unicode in both Py2 and Py3.
On Nov 29, 2009, at 8:47 AM, Stefan Behnel wrote:
> Robert Bradshaw, 28.11.2009 22:12:
>> My personal concern is the pain I see porting Sage to Py3. I'd have
>> to
>> go through the codebase and throw in encodes() and decodes() and
>> change signatures of functions that take char* arguments
(Continue reading)
RSS Feed