diff OrthancServer/Sources/ServerJobs/ArchiveJob.cpp @ 5448:2d23c92c359a

Zip of studies whose PatientName and PatientID did not contain any ASCII character are now valid
author Alain Mazy <am@osimis.io>
date Mon, 27 Nov 2023 09:05:05 +0100
parents b83192e7ad10
children 9ffd6d18daf3
line wrap: on
line diff
--- a/OrthancServer/Sources/ServerJobs/ArchiveJob.cpp	Fri Nov 24 18:14:52 2023 +0100
+++ b/OrthancServer/Sources/ServerJobs/ArchiveJob.cpp	Mon Nov 27 09:05:05 2023 +0100
@@ -34,6 +34,7 @@
 #include "../ServerContext.h"
 
 #include <stdio.h>
+#include <boost/range/algorithm/count.hpp>
 
 #if defined(_MSC_VER)
 #define snprintf _snprintf
@@ -962,7 +963,8 @@
 
       path = Toolbox::StripSpaces(Toolbox::ConvertToAscii(path));
 
-      if (path.empty())
+      if (path.empty() 
+          || (static_cast<size_t>(boost::count(path, '^')) == path.size()))  // this happens with non ASCII patient names: only the '^' remains and this is not a valid zip folder name
       {
         path = std::string("Unknown ") + EnumerationToString(GetResourceLevel(level));
       }