From f231db0aff88923233097c2d3d4325b4b2472761 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Tue, 29 Oct 2019 10:06:02 +0100 Subject: [PATCH] Remove newlines and other characters from material names --- src/ifcgeom_schema_agnostic/IfcGeomRenderStyles.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ifcgeom_schema_agnostic/IfcGeomRenderStyles.h b/src/ifcgeom_schema_agnostic/IfcGeomRenderStyles.h index 804e1caa12..2154fe24b4 100644 --- a/src/ifcgeom_schema_agnostic/IfcGeomRenderStyles.h +++ b/src/ifcgeom_schema_agnostic/IfcGeomRenderStyles.h @@ -65,7 +65,9 @@ namespace IfcGeom { std::stringstream sstr; std::string sanitized = name; boost::to_lower(sanitized); - boost::replace_all(sanitized, " ", "-"); + std::replace_if(sanitized.begin(), sanitized.end(), [](char c) { + return c < 0x21 || c > 0x7e; + }, '-'); sstr << "surface-style-" << id << "-" << sanitized; this->name = sstr.str(); }