Metro style HTML & javascript app
I created a folder named 'data' at the root of my project. I added a javascript file named x.js using Add | New Item from the Solution Explorer. Within that file I have the following:
[
]
(yes, there is a CRLF between the two brackets)
I use something similar to the following to read and parse the file as json:
Windows.Storage.PathIO.readTextAsync("ms-appx:///data/conference.js", Windows.Storage.Streams.UnicodeEncoding.utf8)
.then(function(s){var o = JSON.parse(s);});
This throws an Invalid Character exception from the JSON.parse(). If I .trim() the string before parsing then there is no error:
var o = JSON.parse(s.trim());
Could PathIO.readTextAsync() be returning the Byte Order Mark?
TIA
-Mike