-
Notifications
You must be signed in to change notification settings - Fork 56
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
JSONToTable has problems #3869
Comments
I can't reproduce this. Maybe it's the new version of Notepad Windows 10 is beginning to ship, it could be adding a BOM to the start of the file or something. |
That's very strange, since multiple users on our server can confirm this issue |
Show us the JSON file |
https://steamcommunity.com/sharedfiles/filedetails/?id=1755840967 (now the correct link) But the file does work. It only stops working when edited with the windows text editor |
(I suspect it has something todo with the file ending or the line ends, since I know that the windows text editor behaves differently in this case than other editors) |
Sorry, wrong addon! This one: https://steamcommunity.com/sharedfiles/filedetails/?id=1755840967 |
I can reproduce it with the CTC_DEFAULT table. I'll look into it a little more. |
Yes, notepad is adding a BOM. Probably some automatic thing because of the text in the file. We can probably change JSONToTable to skip it without any issues. |
This is weird because new version removes the BOM mark by default, not adds it as far as I know. |
it's no problem for me since I always use np++. But ther ewere a few users already that reported to me that the addon wasn't working since they used the windows text editor even though I have a warning at the top of the docu. |
Fixed, util.JSONToTable now skips the UTF-8 BOM mark. |
nice, thank you! |
Details & Steps to Reproduce
The function
util.JSONToTable
has problems with json files created with the windows text editor. Files created with notepad ++ work thoughAn easy way to test is by using
util.TableToJSON
and saving the output in a*.txt
-file. Opening and edit it with notepad++ and you're still able to read and parse the file as a table. But once you open, edit and save it with the windows text editor, it stops working. Reading the file still works and a print shows, that it is read correct, bututil.JSONToTable
returnsnil
when passed the JSON string without any errors.It seems like
util.JSONToTable
is not that robust to formating.The text was updated successfully, but these errors were encountered: