We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

After updating an old project, read JSON puzzle can’t interpret data

Home Forums General Questions After updating an old project, read JSON puzzle can’t interpret data

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #81591
    johngrigni
    Customer

    I can load in a txt file with JSON data, but it can’t interpret it. I’m attaching the error from the console. I’m also attaching the puzzles in question – the first ‘print to console’ works, but not the second. I tried it without the ‘Read JSON From’ puzzle and it set a second error (also attached).

    Any help would be appreciated.

    #81595

    Hi,
    It appears there is a syntax error in “read json” (and this puzzle is required in your case). Try to console.log loaded data first to see if the content of your text file is correct. Alternatively, use some online JSON validation tool.

    Soft8Soft Tech Chief
    X | FB | LinkedIn

    #81608
    johngrigni
    Customer

    But the JSON file is unchanged. It works before making any changes to the puzzles or updating the app, and doesn’t work afterward. If it matters, the original was done in verge3d 4.5

    #81612

    Looks like something has changed…
    Could you please share what printed to the console if you place “print to console” → “loaded data” right before JSON parsing? Also what kind of server you use? And lastly, is it possible to attach the salamanderCabinetJson.txt file here?

    Soft8Soft Tech Chief
    X | FB | LinkedIn

    #81613
    johngrigni
    Customer

    Here is what shows on the console. I’m also attaching the txt file.

    I’m not sure what you mean by server, I’m working on a Macbook M1 Air 2020, running Sequoia 15.4.1. The verge version is 4.9.2, but the app still says 4.5.1 (as you can see in the screenshot)

    #81620

    Hi,

    Thanks for sending this JSON file. The issue is that it has invalid encoding (see these two ?? characters in the console output you provided). According to the first two bites FF FE the file is stored in UTF-16 (LE):

    00000000  ff fe 7b 00 0d 00 09 00  22 00 63 00 61 00 62 00  |..{.....".c.a.b.|
    00000010  69 00 6e 00 65 00 74 00  73 00 22 00 20 00 3a 00  |i.n.e.t.s.". .:.|

    The only encoding acceptable for “read JSON from” is UTF-8 and this is the only encoding that should used everywhere on the web. Please resave your txt file with UTF-8.

    Why it was working before? Perhaps there was some hidden conversion made under the hood, need to check it :unsure:

    Soft8Soft Tech Chief
    X | FB | LinkedIn

    #81623
    johngrigni
    Customer

    Thank you! that worked perfectly!

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.