diff --git a/src/ifcconvert/IfcConvert.cpp b/src/ifcconvert/IfcConvert.cpp index d69e4345e5..6d4e8a7123 100644 --- a/src/ifcconvert/IfcConvert.cpp +++ b/src/ifcconvert/IfcConvert.cpp @@ -603,12 +603,18 @@ int main(int argc, char** argv) { // These serializers do not support opening unicode paths. Therefore // a random temp file is generated using only ASCII characters instead. std::random_device rng; - std::uniform_int_distribution index_dist(L'A', L'Z'); - output_temp_filename = L".ifcopenshell."; - for (int i = 0; i < 8; ++i) { - output_temp_filename.push_back(static_cast(index_dist(rng))); + std::uniform_int_distribution index_dist('A', 'Z'); + { + std::string v = ".ifcopenshell."; + output_temp_filename += path_t(v.begin(), v.end()); + } + for (int i = 0; i < 8; ++i) { + output_temp_filename.push_back(static_cast(index_dist(rng))); + } + { + std::string v = ".tmp."; + output_temp_filename += path_t(v.begin(), v.end()); } - output_temp_filename += L".tmp"; } SerializerSettings settings;