comparison 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
comparison
equal deleted inserted replaced
2378:116ade1eff82 2379:4900688827a8
32 32
33 33
34 #include "../PrecompiledHeaders.h" 34 #include "../PrecompiledHeaders.h"
35 #include "Font.h" 35 #include "Font.h"
36 36
37 #if !defined(ORTHANC_ENABLE_LOCALE)
38 # error ORTHANC_ENABLE_LOCALE must be defined to use this file
39 #endif
40
37 #include "../SystemToolbox.h" 41 #include "../SystemToolbox.h"
38 #include "../Toolbox.h" 42 #include "../Toolbox.h"
39 #include "../OrthancException.h" 43 #include "../OrthancException.h"
40 44
41 #include <stdio.h> 45 #include <stdio.h>
252 throw OrthancException(ErrorCode_NotImplemented); 256 throw OrthancException(ErrorCode_NotImplemented);
253 } 257 }
254 258
255 int a = x; 259 int a = x;
256 260
261 #if ORTHANC_ENABLE_LOCALE == 1
257 std::string s = Toolbox::ConvertFromUtf8(utf8, Encoding_Latin1); 262 std::string s = Toolbox::ConvertFromUtf8(utf8, Encoding_Latin1);
263 #else
264 // If the locale support is disabled, simply drop non-ASCII
265 // characters from the source UTF-8 string
266 std::string s = Toolbox::ConvertToAscii(utf8);
267 #endif
258 268
259 for (size_t i = 0; i < s.size(); i++) 269 for (size_t i = 0; i < s.size(); i++)
260 { 270 {
261 if (s[i] == '\n') 271 if (s[i] == '\n')
262 { 272 {