Skip to content

IfcOpenshell.open reads utf-8, but writes it differently making file unreadable. #21

Description

@Tmagga

i've made a script that reads an .ifc file. then adds a pset and properties( i dont make any changes to the original, just add). And writes a new .ifc file that is a copy of the original+the additions.
It works great until i get some utf-8 (or any spec char unicode)values.
it reads and decodes it fine: (from notepad++)

2921= IFCBUILDINGELEMENTPROXYTYPE('3QPADpsq71CHeCe7e3GDm5',#32,'D\X2\00F8\X0\r',$,$,$,$,'DA64A373-DB41-C131-1A0C-A07A0340DC05',$,.NOTDEFINED.);

prints: Dør

but when its writing the file the same element get a diff unicode:

2921=IFCBUILDINGELEMENTPROXYTYPE('3QPADpsq71CHeCe7e3GDm5',#32,'D\X4\000000F8\X0\r',$,$,$,$,'DA64A373-DB41-C131-1A0C-A07A0340DC05',$,.NOTDEFINED.);

and the file is unreadable by the ifc utilizing software (Solibri MC).

is there any way of making IfcOpenshell write it with the same unicode as it reads? or can i force what encoding it should use when writing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions