Page 2 of 2
Re: Why JSON files sometimes fail after Save?
Posted: Sun Sep 14, 2025 10:15 am
by Flinx
By the way, the Seek line can be removed from the position where the BOM was found. Initially, I had the Seek(id, 0) directly after ReadBytes, which I then moved down, but then I forgot to delete the Seek(id, 3). The file cursor is already at position 3 there.
Re: Why JSON files sometimes fail after Save?
Posted: Sun Sep 14, 2025 12:46 pm
by airsoftsoftwair
Flinx wrote: ↑Sat Sep 13, 2025 5:41 pm
I think this is a bug.
Actually not. The BOM character is illegal in JSON so it's not a bug. See
here.
Re: Why JSON files sometimes fail after Save?
Posted: Sun Sep 14, 2025 1:37 pm
by Flinx
airsoftsoftwair wrote: ↑Sun Sep 14, 2025 12:46 pm
Actually not. The BOM character is illegal in JSON so it's not a bug.
Ah, interesting. But it probably won't help much to tell the developers of Visual Studio Code that...
Re: Why JSON files sometimes fail after Save?
Posted: Sun Sep 14, 2025 8:57 pm
by Bugala
Also, as I mentioned, this problem occurs when I am saving with Hollywood IDE as well.
It appears, that by default Hollywood IDE is saving as UTF-8 BOM.
Can you change Hollywood IDE by default to use UTF-8 only, or would that affect Hollywood scripts? Point being, that it is bit confusing that you cant use Hollywood IDE out of the box to do something as standard as JSON, without first manually changing the settings to save files as plain UTF-8 instead of the BOM version like it seems to be doing at least in my case, or is this something that windows automatically configures instead of IDE doing it?
Re: Why JSON files sometimes fail after Save?
Posted: Tue Sep 16, 2025 8:55 am
by Flinx
Hmm, Bugala, JSON is a data interchange format. That means it is intended to be written by programs and read by parsers that have been specifically developed for this purpose. The fact that it can be read and written in an editor makes life easier for developers (at least if they know what they're doing), but that doesn't mean it's a completely normal procedure.
So I think we really shouldn't demand support for a private way of working from an editor that is intended as a universal tool for all kinds of text, or in the case of the IDE, specifically for Hollywood scripts.
Re: Why JSON files sometimes fail after Save?
Posted: Tue Sep 16, 2025 12:05 pm
by jalih
Flinx wrote: ↑Tue Sep 16, 2025 8:55 am
So I think we really shouldn't demand support for a private way of working from an editor that is intended as a universal tool for all kinds of text, or in the case of the IDE, specifically for Hollywood scripts.
It's normal procedure to edit JSON with text editor or any other tool. BOM is not needed or recommended to be used with UTF-8, so it makes no sense for a text editor to add a BOM to UTF-8 text.
Re: Why JSON files sometimes fail after Save?
Posted: Tue Sep 16, 2025 1:20 pm
by Bugala
Flinx wrote: ↑Tue Sep 16, 2025 8:55 am
Hmm, Bugala, JSON is a data interchange format. That means it is intended to be written by programs and read by parsers that have been specifically developed for this purpose. The fact that it can be read and written in an editor makes life easier for developers (at least if they know what they're doing), but that doesn't mean it's a completely normal procedure.
So I think we really shouldn't demand support for a private way of working from an editor that is intended as a universal tool for all kinds of text, or in the case of the IDE, specifically for Hollywood scripts.
Ah, appears I have misunderstood JSONs point then. Thought it was like HTML, that it is meant to be an easy way to create these datatables and doable on any text editor basically. Makes sense it would have these restrictions when you put it that way.
Re: Why JSON files sometimes fail after Save?
Posted: Fri Sep 19, 2025 8:58 pm
by airsoftsoftwair
Flinx wrote: ↑Sun Sep 14, 2025 1:37 pm
Interesting. But it probably won't help much to tell the developers of Visual Studio Code that...
Well, not the first time MS programmers don't care about specifications
Bugala wrote: ↑Sun Sep 14, 2025 8:57 pm
Can you change Hollywood IDE by default to use UTF-8 only, or would that affect Hollywood scripts?
You can do it yourself. In the IDE settings you can select whether files should be saved as UTF-8, UTF-8 with BOM or ISO 8859-1.