-
Notifications
You must be signed in to change notification settings - Fork 387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change unit definition JSON from UTF-8-BOM to UTF-8 #730
Conversation
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
Otherways the js JSON parse method returns `SyntaxError: Unexpected token in JSON at position 0` error.
SyntaxError: Unexpected token ] in JSON at position 2871
Codecov Report
@@ Coverage Diff @@
## master #730 +/- ##
=======================================
Coverage 58.56% 58.56%
=======================================
Files 171 171
Lines 38430 38430
=======================================
Hits 22507 22507
Misses 15923 15923 Continue to review full report at Codecov.
|
This is probably the UTF-8 BOM characters you are seeing. I believe it causes problems on the web, where UTF-8 files are expected to not include the BOM character. I'll try your change and if it doesn't break anything, I think we can merge it in. Will get back to you. |
Regenerating code locally does not seem to do any changes except a couple of innocent whitespace changes, so this change should be safe 👍 Famous last words! |
Confirmed files are now encoded with utf-8 and not utf-8-bom. |
Thanks! Also, I dig that you made a javascript equivalent. We had an issue #410 on this before, but I never had the time or incentive to put the time into something like that. Very nice! |
* Remove local units definitions #2 * Fetch units definitions from the original angularsen unitsnet repo angularsen/UnitsNet#730 #2
When I developed a similar generated library for JavaScript (called unitsnet-js) from those units definition files, the JavaScript JSON parser failed because most of the schemas start with an unknown character.
The unknown character is shown only in the live web version, when I used git to clone the repo, the character has gone (Tested on Windows 10 OS). this why the fix is separated into each file one commit.
This is how it's look in the GitHub web version: