From 9b32647fa4ee346f48f82e6b2fc1491a11f3fe6f Mon Sep 17 00:00:00 2001 From: rgaudin Date: Thu, 8 May 2014 20:22:23 +0000 Subject: [PATCH] Added ICU external dat table support for components (req. check for binaries) --- src/common/kiwix/searcher.cpp | 11 +++++++++++ src/common/kiwix/searcher.h | 1 + 2 files changed, 12 insertions(+) diff --git a/src/common/kiwix/searcher.cpp b/src/common/kiwix/searcher.cpp index 8d80403de..a9201f010 100644 --- a/src/common/kiwix/searcher.cpp +++ b/src/common/kiwix/searcher.cpp @@ -34,6 +34,17 @@ namespace kiwix { resultRange(20) { template_ct2 = getResourceAsString("results.ct2"); +#ifdef __APPLE__ + string executablePath = getExecutablePath(); + string executableDirectory = removeLastPathElement(executablePath); + string datPath = computeAbsolutePath(executableDirectory, "icudt49l.dat"); + try { + u_setDataDirectory(datPath.c_str()); + } catch (exception &e) { + std::cerr << e.what() << std::endl; + } +#endif + } /* Search strings in the database */ diff --git a/src/common/kiwix/searcher.h b/src/common/kiwix/searcher.h index 3cf2c6cbb..fd653078b 100644 --- a/src/common/kiwix/searcher.h +++ b/src/common/kiwix/searcher.h @@ -31,6 +31,7 @@ #include #include #include +#include "unicode/putil.h" #include #include