Commit 7cd7d23d authored by Stefan Behnel's avatar Stefan Behnel

unicode fixes

parent c786d3c0
...@@ -4312,11 +4312,7 @@ static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/ ...@@ -4312,11 +4312,7 @@ static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/
""",""" ""","""
static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) { static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) {
while (t->p) { while (t->p) {
#if PY_MAJOR_VERSION < 3
*t->p = PyString_InternFromString(t->s); *t->p = PyString_InternFromString(t->s);
#else
*t->p = PyUnicode_InternFromString(t->s);
#endif
if (!*t->p) if (!*t->p)
return -1; return -1;
++t; ++t;
...@@ -4334,13 +4330,13 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ ...@@ -4334,13 +4330,13 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
while (t->p) { while (t->p) {
if (t->is_unicode) { if (t->is_unicode) {
*t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
} else {
#if PY_MAJOR_VERSION < 3 #if PY_MAJOR_VERSION < 3
*t->p = PyString_FromStringAndSize(t->s, t->n - 1); *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
#else #else
*t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
#endif #endif
} else {
*t->p = PyString_FromStringAndSize(t->s, t->n - 1);
} }
if (!*t->p) if (!*t->p)
return -1; return -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment