xBimTeam / XbimEssentials

A .NET library to work with data in the IFC format. This is the core component of the Xbim Toolkit
https://xbimteam.github.io/
Other
477 stars 171 forks source link

String decoding #533

Open simonedd opened 8 months ago

simonedd commented 8 months ago

I have a file with some "special" characters, as in the following Beam definition. #857=IFCBEAM('3Lt4H72Y9CHQEeh3VllZNY',#6,'\S\Z\S\l. n\S\ametk. krokev',$,$,#821,#840,$);

After the parsing, the instance of the Beam is empty. {#857=IFCBEAM('3Lt4H72Y9CHQEeh3VllZNY',#6,$,$,$,$,$,$);}

Thanks.

martin1cerny commented 8 months ago

IFC file is defined to be an ASCII file. Your example seems to combine Unicode(or some other encoding) and IFC string encoding. This is likely causing the scanner to fail to parse the data. Bear in mind this is an illegal IFC file.

simonedd commented 6 months ago

Sorry to come back to this so late. I agree, but you should skip invalid characters instead of failing the reading of the entire entity. All other readers I've tried can import the entity.