Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: After reading a text with special character '\X\80' becomes all texts with special characters unreadable #986

Open
jespa007 opened this issue Aug 7, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@jespa007
Copy link
Contributor

jespa007 commented Aug 7, 2024

What happened?

After reading a text with special character '\X\80' becomes all texts with special characters unreadable

I have created this IFC ISSUE_RVT22_WithSpecialValue.zip that has a PSET at line 145 with a text that contents the character '\X\80'.

Also I have created the following code in node that is runnable if is placed at directory tests\issues in order to reproduce the error. The code reads PSET at line 146 with a text with special characters in SPAIN and it reads fine. Then it reads a PSET with a text that contents the character '\X\80' and finally it reads again PSET 146 and all special characters that were read fine before now it turns unreadable.

const fs = require("fs");
const WebIFC = require('../../dist/web-ifc-api-node');

let newIfcAPI = new WebIFC.IfcAPI();

async function test(){
	await newIfcAPI.Init();

	const content = fs.readFileSync("../ifcfiles/public/ISSUE_RVT22_WithSpecialValue.ifc");

	let modelID = newIfcAPI.OpenModel(content);

	// 1. Read PSET at line #146 
	let line=newIfcAPI.GetLine(modelID,146);
	console.log("Parsed PSET value at line #146 :"+line.NominalValue.value + " -> Read speacial characters in SPAIN OK");

	// 2. Read PSET at linr #145 with special character  x80
	line=newIfcAPI.GetLine(modelID,145);
	console.log("Parsed PSET value at line #145 :"+line.NominalValue.value + " -> Reads special character x80 and ends with strange character");

	// 3. Try to read again PSET at line #146
	line=newIfcAPI.GetLine(modelID,146);
	console.log("Parsed PSET value at line #146 :" +line.NominalValue.value + " -> This time the special characters becomes unreadable now");

	newIfcAPI.CloseModel(modelID);
};

test();

The output is the following,

Parsed PSET value at line #146 :Válido, pestaña -> Read speacial characters in SPAIN OK
Parsed PSET value at line #146 :12888,43Ä -> Reads special character x80 and ends with strange character
Parsed PSET value at line #146 :V·lido, pestaÒa -> This time the special characters becomes unreadable now

Version

Latest

What browsers are you seeing the problem on?

No response

Relevant log output

Parsed PSET value at line #146 :Válido, pestaña -> Read speacial characters in SPAIN OK
Parsed PSET value at line #146 :12888,43Ä -> Reads special character x80 and ends with strange character
Parsed PSET value at line #146 :V·lido, pestaÒa -> This time the special characters becomes unreadable now

Anything else?

The IFC and code that reproduces the error is already attached

@jespa007 jespa007 added the bug Something isn't working label Aug 7, 2024
@jespa007 jespa007 changed the title [Bug]: After reading a text with speacial character '\X\80', GetLine return all texts with weird characters [Bug]: After reading a text with speacial character '\X\80' becomes all texts with special characters unreadable Aug 7, 2024
@jespa007 jespa007 changed the title [Bug]: After reading a text with speacial character '\X\80' becomes all texts with special characters unreadable [Bug]: After reading a text with special character '\X\80' becomes all texts with special characters unreadable Aug 7, 2024
@beachtom beachtom self-assigned this Aug 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants