try the ascii version of cmsGetProfileInfo

This commit is contained in:
wiredfool 2013-10-01 23:22:37 -07:00
parent e9e5599412
commit 135c47e82a

View File

@ -512,18 +512,20 @@ _profile_getattr(CmsProfileObject* self, cmsInfoType field)
{ {
// UNDONE -- check that I'm getting the right fields on these. // UNDONE -- check that I'm getting the right fields on these.
// return PyUnicode_DecodeFSDefault(cmsTakeProductName(self->profile)); // return PyUnicode_DecodeFSDefault(cmsTakeProductName(self->profile));
wchar_t buf[256]; //wchar_t buf[256]; -- UNDONE need wchar_t for unicode version.
char buf[256];
cmsUInt32Number written; cmsUInt32Number written;
written = cmsGetProfileInfo(self->profile, written = cmsGetProfileInfoASCII(self->profile,
field, field,
"en", "en",
"us", "us",
buf, buf,
256); 256);
if (written) { if (written) {
return PyUnicode_DecodeFSDefault(buf); return PyUnicode_DecodeFSDefault(buf);
} }
return NULL; // UNDONE suppressing error here by sending back blank string.
return PyUnicode_DecodeFSDefault("");
} }
static PyObject* static PyObject*