Linux: Dont fail on systems with fonts that have non-UTF-8 names. Fixes #1281
This commit is contained in:
parent
89be7a031d
commit
4273cb35bf
@ -24,11 +24,12 @@ pyspacing(int val) {
|
||||
#undef S
|
||||
}
|
||||
|
||||
|
||||
static inline PyObject*
|
||||
pattern_as_dict(FcPattern *pat) {
|
||||
PyObject *ans = PyDict_New();
|
||||
if (ans == NULL) return NULL;
|
||||
#define PS(x) PyUnicode_FromString((char*)x)
|
||||
#define PS(x) PyUnicode_Decode((const char*)x, strlen((const char*)x), "UTF-8", "replace")
|
||||
#define G(type, get, which, conv, name) { \
|
||||
type out; PyObject *p; \
|
||||
if (get(pat, which, 0, &out) == FcResultMatch) { \
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user