changeset 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 dacdce5e5c22
children 29858f424fc7
files NEWS OrthancServer/Sources/ServerJobs/ArchiveJob.cpp
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Fri Nov 24 18:14:52 2023 +0100
+++ b/NEWS	Mon Nov 27 09:05:05 2023 +0100
@@ -33,6 +33,7 @@
 
 * Solved a deadlock related to the Job Engine events and plugins.  Job events are now pushed
   into a queue to be handled asynchronously by plugins.
+* Zip of studies whose PatientName and PatientID did not contain any ASCII character are now valid.
 
 
 REST API
--- 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));
       }