create3000 / x_ite

X_ITE X3D Browser, view and manipulate X3D, VRML, glTF and other 3D sources in HTML.
https://create3000.github.io/x_ite/
Other
67 stars 15 forks source link

X_ITE fails to parse compressed file containing a Windows-1252 encoded é (0xE9) #62

Closed Sgeo closed 4 years ago

Sgeo commented 4 years ago

Describe the bug X_ITE does not parse some files with non-Ascii characters that are encoded in Windows-1252 and compressed with gzip.

Some testing indicates that it works fine with UTF-8, and it works fine uncompressed.

To Reproduce Steps to reproduce the behavior:

  1. Attempt to load http://x-3-x.net/vrml/archive/2ndworld/commserv/community/places/brassens/vrml/musee.wrl

Expected behavior A parsing error on line 127 regarding an improperly placed ROUTE statement. (That's this file's problem, not X_ITE's. I have some code elsewhere to allow files like this to load)

Screenshots The line with é occurs immediately before the indicated Viewpoint. image

x_ite.js:52164 Couldn't load URL 'musee.wrl.gz': 
********************************************************************************
Parser error at line 105:68
in 'http://localhost:8000/musee.wrl.gz'

Viewpoint{position 6 1.7 7 fieldOfView .635398 description "couloir"}
                                                                   ^
Unknown field 'couloir' in class 'Viewpoint'.
********************************************************************************

Additional context

musee3.wrl.gz has the é deleted. musee4.wrl.gz has the file re-encoded as UTF-8.

Sgeo commented 4 years ago

Come to think of it, VRML 2.0 files all explicitly claim to be UTF-8, so I guess that in theory it's this file's fault.

create3000 commented 4 years ago

Yes this is right. UTF-8 is the standard for X3D files. Consider converting your files to UTF-8. Every modern text editor can do that for you.