Ticket #263 (closed defect: fixed)
Inconsistent file encoding breaks spidermonkey on Mac OS X
| Reported by: | espes | Owned by: | |
|---|---|---|---|
| Priority: | Should Have | Milestone: | Pre-Alpha 1 |
| Component: | Non-game systems | Keywords: | |
| Cc: |
Description
exe name before realpath: /Volumes/Data/Development/Compiling/0AD/trunk/binaries/system/./pyrogenesis_dbg exe name after realpath: /Volumes/Data/Development/Compiling/0AD/trunk/binaries/system/./pyrogenesis_dbg returning exe name: /Volumes/Data/Development/Compiling/0AD/trunk/binaries/system/pyrogenesis_dbg TIMER| InitVfs: 1.603 ms TIMER| InitScripting: 7.995 ms TIMER| CONFIG_Init: 8.452 ms TIMER| write_sys_info: 1.098 ms TIMER| ps_console: 17.498 ms TIMER| ps_lang_hotkeys: 6.716 ms TIMER| ps_gui_init: 187 us TIMER| ps_gui_setup_xml: 4.976 ms TIMER| ps_gui_styles_xml: 2.096 ms TIMER| ps_gui_sprite1_xml: 61.773 ms (current document)(0): malformed UTF-8 character sequence at offset 25199 ERROR: JavaScript Error ((current document), line 0): malformed UTF-8 character sequence at offset 25199 terminate called after throwing an instance of 'PSERROR_Scripting_LoadFile_EvalErrors' what(): Scripting_LoadFile_EvalErrors Abort trap
I eventually tracked this down to gui/test/functions_page_session_status_commands.js, which was in some ISO-* encoding, instead of UTF-8. This problem exists for quite a few other files as well. Spidermonkey fails to parse them, and dies.
Change History
comment:3 Changed 4 years ago by Philip
- Status changed from new to closed
- Resolution set to fixed
Fixed functions_page_session_status_commands.js in r6995 (by changing it to ASCII). Thanks!
I can't find the problem in any other files - all the .xml and .js seem to be purely ASCII, except for some XML that's explicitly iso-8859-1 or that has a UTF-8 BOM. I'll mark this as fixed now, but please reopen it if there are files I missed.
comment:4 Changed 4 years ago by espes
- Status changed from closed to reopened
- Resolution fixed deleted
Thanks. The other one that causes issues is the "tips.txt" file.
And thanks for converting the line endings too, silly windows and its \r\n
comment:5 Changed 4 years ago by Philip
- Status changed from reopened to closed
- Resolution set to fixed
Oh, didn't notice that one. Changed to UTF-8 now, and changed the relevant code to decode as UTF-8, so it should be okay now (unless I missed any others!)
