pycarddav: Add utf8-decode patch [2]
authorStefan Huber <shuber@sthu.org>
Mon, 16 Apr 2018 16:56:07 +0000 (18:56 +0200)
committerStefan Huber <shuber@sthu.org>
Mon, 16 Apr 2018 16:56:07 +0000 (18:56 +0200)
app-misc/pycarddav/files/utf8-decode.patch [new file with mode: 0644]

diff --git a/app-misc/pycarddav/files/utf8-decode.patch b/app-misc/pycarddav/files/utf8-decode.patch
new file mode 100644 (file)
index 0000000..b29cedd
--- /dev/null
@@ -0,0 +1,17 @@
+--- a/pycarddav/model.py       2018-04-15 18:49:08.335147745 +0200
++++ b/pycarddav/model.py       2018-04-15 18:49:53.957408081 +0200
+@@ -207,7 +207,13 @@
+     @property
+     def fname(self):
+-        return unicode(self['FN'][0][0]) if self['FN'] else ''
++        utext = self['FN'][0][0] if self['FN'] else ''
++        try:
++            utext = unicode(utext, 'utf8')
++        except TypeError:
++            pass
++
++        return utext
+     @fname.setter
+     def fname(self, value):