0

I am creating an application to work with another application called league of legends. Their itemsets in game may be locally saved json files. My application generates a json string and writes to a .json. The files do not appear in game. I am using visual studio 2015, vb.net.

The strange part is that I can use notepad++ to copy my generated file into a new file and save it. The file then appears in game with no issues. I used the opentextwriter to write the files.

Any suggestions why this happens or how to fix the issue? Thank you.

Ralph Maurmeier
  • 101
  • 1
  • 10
  • A guess would be line endings, if your JSON is formatted. You could try installing WinMerge, which has an option to highlight or ignore line endings and compare your vb generated file with the notepad++ saved file. – GregHNZ Jul 15 '16 at 04:26
  • I will try that, I did remove the line endings in the original file in notepad++ to test the same reasoning, but I will gladly try it. – Ralph Maurmeier Jul 15 '16 at 15:34
  • 1
    It is possible that your string is being written with a BOM. JSON strings must not start with a BOM. If you had shown the code you use to write the string, we would have been able to help you make the adjustment. Ref: [JSON Specification and usage of BOM/charset-encoding](http://stackoverflow.com/a/38036753/1115360). – Andrew Morton Jul 15 '16 at 16:38
  • You are exactly right Andrew, thank you very much! My friend came to the same conclusion but your link helped me understand what he was trying to say. – Ralph Maurmeier Jul 15 '16 at 23:33

1 Answers1

0

It is possible that your string is being written with a BOM. JSON strings must not start with a BOM. If you had shown the code you use to write the string, we would have been able to help you make the adjustment. Ref: JSON Specification and usage of BOM/charset-encoding. – Andrew Morton Jul 15 '16 at 16:38

Ralph Maurmeier
  • 101
  • 1
  • 10