because we have no easy way to convert the python encoding string to
a CF encoding parameter.
if (v == Py_None) { *p_itself = NULL; return 1; }
if (PyString_Check(v)) {
char *cStr;
- if (!PyArg_Parse(v, "et", "ascii", &cStr))
+ if (!PyArg_Parse(v, "es", "ascii", &cStr))
return NULL;
*p_itself = CFStringCreateWithCString((CFAllocatorRef)NULL, cStr, kCFStringEncodingASCII);
return 1;
UniChar *unichars;
if (PyString_Check(src)) {
- if (!PyArg_Parse(src, "es", NULL, &chars))
+ if (!PyArg_Parse(src, "es", "ascii", &chars))
return NULL; /* This error is more descriptive than the general one below */
*dst = CFStringCreateWithCString((CFAllocatorRef)NULL, chars, kCFStringEncodingASCII);
return 1;