[evince] DjVu: support for utf8 filenames on Mac OS X



commit 9fe48d1fca95b0fd896f5266265ea21a418d3973
Author: Tom Schoonjans <Tom Schoonjans diamond ac uk>
Date:   Sun Jan 31 20:03:42 2016 +0530

    DjVu: support for utf8 filenames on Mac OS X
    
    Filename encoding on Mac OS X is in UTF-8, which means that DjVu
    documents must be opened with ddjvu_document_create_by_filename_utf8
    instead of ddjvu_document_create_by_filename.
    
    Implemented using a conditional preprocessor macro as this may affect
    other operating systems.
    
    Since ddjvu_document_create_by_filename_utf8 was added only in 3.5.22,
    the pkg-config check for djvulibre was changed accordingly.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=761161

 backend/djvu/djvu-document.c |    6 +++++-
 configure.ac                 |    4 ++--
 2 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/backend/djvu/djvu-document.c b/backend/djvu/djvu-document.c
index 06ce813..6711f31 100644
--- a/backend/djvu/djvu-document.c
+++ b/backend/djvu/djvu-document.c
@@ -164,8 +164,12 @@ djvu_document_load (EvDocument  *document,
        filename = g_filename_from_uri (uri, NULL, error);
        if (!filename)
                return FALSE;
-       
+
+#ifdef __APPLE__
+       doc = ddjvu_document_create_by_filename_utf8 (djvu_document->d_context, filename, TRUE);
+#else
        doc = ddjvu_document_create_by_filename (djvu_document->d_context, filename, TRUE);
+#endif
 
        if (!doc) {
                g_free (filename);
diff --git a/configure.ac b/configure.ac
index 318cb70..2dcd962 100644
--- a/configure.ac
+++ b/configure.ac
@@ -600,7 +600,7 @@ AC_ARG_ENABLE(djvu,
            [enable_djvu=yes])
 
 if test "x$enable_djvu" = "xyes"; then
-    DJVULIBRE_REQUIRED=3.5.17
+    DJVULIBRE_REQUIRED=3.5.22
     PKG_CHECK_MODULES(DJVU, ddjvuapi >= $DJVULIBRE_REQUIRED, enable_djvu=yes, enable_djvu=no)
 
     if test "x$enable_djvu" = "xyes"; then
@@ -608,7 +608,7 @@ if test "x$enable_djvu" = "xyes"; then
     else
        AC_MSG_WARN([   
 ** Djvu support is disabled since a recent version of the djvulibre 
-** library was not found. You need at least djvulibre-3.5.17 which 
+** library was not found. You need at least djvulibre-3.5.22 which
 ** can be found on http://djvulibre.djvuzone.org 
 ])
     fi 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]