"Unexpected token" for JSON files with non-UTF-8 encoding
See original GitHub issueSome songs can’t be previewed and display an error:
Uncaught SyntaxError: Unexpected token � in JSON at position 0
at JSON.parse (<anonymous>)
at ZipLoader.extractAsJSON (build.js:274)
at Object.keys.forEach.filename (build.js:96)
at Array.forEach (<anonymous>)
at ZipLoader.loader.on (build.js:96)
at ZipLoader.dispatch (build.js:274)
at XMLHttpRequest.xhr.onload (build.js:274)
This is due to non-UTF-8 encoding in .json files (checked with Notepad++).
Examples of UCS-2 LE BOM in info.json:
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
757: unexpected token a t '{ (JSON::ParserError)
I'm getting a ParserError when running a Ruby script which generates translated HTML files from a JSON file. The encoding of the JSON...
Read more >Bug when parsing JSON in superagent/lib/node/parsers/json.js
When I open the stacktrace : { SyntaxError: Unexpected token in JSON at posit... ... It may also be caused by use...
Read more >How to Remove Non UTF-8 Characters From a File - Baeldung
Learn how to detect and remove non-UTF-8 characters from a file. ... Trunctated #### Uncaught SyntaxError: Unexpected identifier
Read more >How to fix Unexpected Token in JSON error (for ... - YouTube
Not a programmer? Read this! ** - If you get this error in an app you didn't make, and/or you're not a web...
Read more >encoding/xml - Go Packages
Unmarshal parses the XML-encoded data and stores the result in the value ... if Token encounters an unexpected end element or EOF before...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We can’t live without kpop!
Thanks, I had some code to normalize it, I’ll add it later.