From b41704341f392de44aa6379f3825eb29476d7bc9 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 24 Jan 2010 14:13:05 -0700 Subject: [PATCH] Fix #4654 (Diacritical characters do not display in OSX notifications) --- src/calibre/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/calibre/__init__.py b/src/calibre/__init__.py index ec56d340cf..e32c03fe13 100644 --- a/src/calibre/__init__.py +++ b/src/calibre/__init__.py @@ -117,9 +117,12 @@ def prints(*args, **kwargs): try: arg = arg.encode(enc) except UnicodeEncodeError: - if not safe_encode: - raise - arg = repr(arg) + try: + arg = arg.encode('utf-8') + except: + if not safe_encode: + raise + arg = repr(arg) if not isinstance(arg, str): try: arg = str(arg)