From: Stefan Huber Date: Mon, 16 Apr 2018 16:56:07 +0000 (+0200) Subject: pycarddav: Add utf8-decode patch [2] X-Git-Url: https://git.sthu.org/?p=shuber-gentoo-overlay.git;a=commitdiff_plain;h=874391c26c382ab484b2f72aeb6436087d3d9109;hp=203e10ddb8e32a26c26764e9ba2c53bb740f612d pycarddav: Add utf8-decode patch [2] --- diff --git a/app-misc/pycarddav/files/utf8-decode.patch b/app-misc/pycarddav/files/utf8-decode.patch new file mode 100644 index 0000000..b29cedd --- /dev/null +++ b/app-misc/pycarddav/files/utf8-decode.patch @@ -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):