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]: The GetLine() API method has an error in parsing Chinese, which may be caused by Unicode encoding. #949

Open
sennhvi opened this issue Jul 18, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@sennhvi
Copy link

sennhvi commented Jul 18, 2024

What happened?

I tried to parse this line: #15236= IFCPROPERTYSINGLEVALUE('soil_layer_name',$,IFCIDENTIFIER('\X2\7d20586b571f\X0\'),$); using web-ifc api method like this const props = await this.ifcapi.GetLine(this.modelId as number, id), and I get incorrect text. After I change '\X2\7d20586b571f\X0\' to uppercase '\X2\7D20586B571F\X0\' and then I get correct text, so I think there is something wrong in text parsing part.

Version

0.0.56

What browsers are you seeing the problem on?

Microsoft Edge

Relevant log output

No response

Anything else?

No response

@sennhvi sennhvi added the bug Something isn't working label Jul 18, 2024
@beachtom beachtom self-assigned this Jul 18, 2024
@sennhvi
Copy link
Author

sennhvi commented Aug 17, 2024

@beachtom I investigated the bug and found that the lowercase letters included in \X2\ and \X0\ in the IFC file not in the correct character range, and the bug that could be fixed was in parsing/string_parsing.cpp, add new line if (value >= 'a' && value <= 'f') return value - 'a' + 10; in function char getNextHex()

After add this line, right decoded:
image

Before add this line, error decoded :
image

this comment may help somehow.

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