Open EK-CEL opened 6 years ago
Hi @EK-CEL
Sorry, it took me a while to figure things out. The issue is caused by the first line of the file
<?xml version="1.0" encoding="utf-16"?>
The gbXML Viewer saved 'Problematic.xml' file in single byte characters UTF-8 but the incoming file was originally saved in double byte characters - UTF 16.
So after saving delete the first line with the xml tag, things were good to go and the file loaded in both OpenStudio and FZK Viewer ( and gbXML Viewer, of course ).
BTW, this explains the 50% reduction in file size as well. ;-)
Questions:
Any thoughts on international file handling appreciated
Also: can I add this file to the demo files?
Wow, you found the reason! Thank you.
My thoughts about your questions:
Yes, you can use the files for project needs.
@EK-CEL
Many of the sample files here are from Revit and are UTF-8
https://github.com/ladybug-tools/spider/tree/master/gbxml-sample-files
So it looks like UTF is a user-selectad Revit setting or derived from the operating system or browser settings.
It turns out that saving to UTF 16 is significantly more complicated than saving to UTF-8. And it would take a lot of test to verify files are OK.
I think the first thing I will try to do is:
if <?xml version="1.0" encoding="utf-16"?>
then just delete the encoding attribute
therefore: <?xml version="1.0"?>
As far as I can see the encoding is optional, See:
https://msdn.microsoft.com/en-us/library/ms256048(v=vs.110).aspx
Thank you for your permission to use your file as a sample gbXML file.
@theo-armour
I believe that as far as we are using pre-existing gbXML file we should keep the initial encoding. So the Spider should "know" how to form such encoding and be able to work with wide spectrum of encoding tables like those I found in the Notepad++:
I think the Spider should reject gbXML files with unknown encoding.
I have uploaded a gbXML file to the Spider and immediately downloaded it back. There were some differences and I fixed them so that the WinMerge app tells the files as identical (regardless of different file size). Unfortunately I can't open the new file with FZK viewer. Please see the gbXML files attached.
Thank you. gbXMLs.zip