diff Core/Images/Font.cpp @ 2379:4900688827a8

reorganization in CMake
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 28 Aug 2017 18:07:03 +0200
parents a3a65de1840f
children 5edec967055e
line wrap: on
line diff
--- a/Core/Images/Font.cpp	Mon Aug 28 15:02:27 2017 +0200
+++ b/Core/Images/Font.cpp	Mon Aug 28 18:07:03 2017 +0200
@@ -34,6 +34,10 @@
 #include "../PrecompiledHeaders.h"
 #include "Font.h"
 
+#if !defined(ORTHANC_ENABLE_LOCALE)
+#  error ORTHANC_ENABLE_LOCALE must be defined to use this file
+#endif
+
 #include "../SystemToolbox.h"
 #include "../Toolbox.h"
 #include "../OrthancException.h"
@@ -254,7 +258,13 @@
 
     int a = x;
 
+#if ORTHANC_ENABLE_LOCALE == 1
     std::string s = Toolbox::ConvertFromUtf8(utf8, Encoding_Latin1);
+#else
+    // If the locale support is disabled, simply drop non-ASCII
+    // characters from the source UTF-8 string
+    std::string s = Toolbox::ConvertToAscii(utf8);
+#endif
 
     for (size_t i = 0; i < s.size(); i++)
     {