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

String encoding - problem with special characters #58

Closed
eng-luciano-julien opened this issue Jun 28, 2021 · 12 comments · Fixed by #176
Closed

String encoding - problem with special characters #58

eng-luciano-julien opened this issue Jun 28, 2021 · 12 comments · Fixed by #176

Comments

@eng-luciano-julien
Copy link

Hi,
I have an issue displaying special characters (ç, é). I am using the encoding utf8 in the web page.
image

The string name came that way in json.
image

@kovacsv
Copy link
Contributor

kovacsv commented Jun 29, 2021

Quick and dirty solution on the JavaScript side:

function DecodeIFCString (ifcString)
{
    const ifcUnicodeRegEx = /\\X2\\(.*?)\\X0\\/uig;
    let resultString = ifcString;
    let match = ifcUnicodeRegEx.exec (ifcString);
    while (match) {
        const unicodeChar = String.fromCharCode (parseInt (match[1], 16));
        resultString = resultString.replace (match[0], unicodeChar);
        match = ifcUnicodeRegEx.exec (ifcString);
    }
    return resultString;
}

@eng-luciano-julien
Copy link
Author

Thank you @kovacsv! It solves the problem.

@agviegas
Copy link
Collaborator

This issue is now a bounty. Whoever solves this will get $100. More information here.

deadman2000 added a commit to deadman2000/web-ifc that referenced this issue Jun 9, 2022
@agviegas agviegas linked a pull request Jun 15, 2022 that will close this issue
agviegas added a commit that referenced this issue Jun 15, 2022
P21 string encoding support (Issue #58)
@hikitan1
Copy link

Hello @agviegas, is this issue already integrated in the web-ifc-viewer?
If not, will it ever be integrated there?

@agviegas
Copy link
Collaborator

Hi @hikitan1 we are setting up the bounties for the rest of the year, and this is one of them, so yes.

@yakovlevkll
Copy link

Hello everyone,

Is it any possible way to use decoder from @deadman2000 with provided javascript API?

@agviegas
Copy link
Collaborator

Hi @yakovlevkll what do you mean? This was already merged.

@yakovlevkll
Copy link

Thank you for your reply @agviegas! I found the problem with the version of web-ifc used in hello-world repo (0.0.35 instead of 0.0.36 with the problem fixed)

@Tamu
Copy link

Tamu commented Mar 15, 2023

Hi everyone,
I have a new issue with the export of Revit 2022.1+ which integrates the ODA SDK exporter (ODA IFC SDK 22.8)

  1. EXPRESS Data Manager : \X2\00E9\X0\
  2. ODA IFC SDK : \X\E9

I confirm that with v1 the characters are ok, but not translated with v2.

I don't know for what obscure reason the Express Data was replaced by ODA !?
update Revit 2022.3

@agviegas
Copy link
Collaborator

Hm, that's strange. Have you asked them? If it's a different encoding, maybe we should make a flexible system that accepts all possible encodings when reading strings.

@Tamu
Copy link

Tamu commented Mar 20, 2023

Thanks @agviegas for your answer !
I found an interesting link: Revit-IFC
This is apparently a change planned by Autodesk since 2022.1+

@agviegas
Copy link
Collaborator

@Tamu awesome. If you find any problems with that, don't hesitate to create a new issue in this repo so that we can help you out. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants