Skip to content

File .scripted fails to parse with BOM #54

Open
cawoodm opened this Issue Dec 11, 2012 · 5 comments

2 participants

@cawoodm
cawoodm commented Dec 11, 2012

If you save .scripted as a UTF-8 (with BOM) you get the following error in the console:
Problems getting scripted configuration:
Couldn't parse (JSON5) 'C:/Marc/Pers/Work/JavaScript/offline/bible/.scripted'
ERROR: SyntaxError: Unexpected ''

@aeisenberg
@cawoodm
cawoodm commented Dec 12, 2012

I stripped the file down to {} and it still failed until I removed the BOM. However this was the original file:

{

    "ui": { 
        "font": "Courier New"
    },

    "editor": {
        "expandtab": true,
        "tabsize": 2
    },

    "jshint" : {
        "global" : ["console", "define", "exports", "module", "process", "__dirname", "require", "$", "window"]
    }

}
@aeisenberg
@cawoodm
cawoodm commented Dec 12, 2012

http://en.wikipedia.org/wiki/Byte_order_mark
It's basically a FEFF byte sequence at the start of a unicode text file which tells the interpreter in which order the bytes of multi-byte characters appear in a byte stream. Unicode is real important to those working in multi-lingual environments. True, your configuration file probably doesn't need to be unicode but many people have switched to unicode on principle and all new files we make are UTF-8.

@aeisenberg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.