std.json

Ali Çehreli acehreli at yahoo.com
Wed Jul 4 09:55:13 PDT 2012


On 07/04/2012 08:25 AM, Alexsej wrote:
 > On Monday, 26 March 2012 at 07:14:50 UTC, Ali Çehreli wrote:

 >> // Assumes UTF-8 file
 >> auto content = to!string(read("json_file"));

 > Your example only works if the json file in UTF-8 (BOM), how to make
 > sure that it worked with the files in UTF-8 without BOM.

I am pretty sure that I have tested it without BOM, which is not 
recommended nor needed for UTF-8 anyway.

If anything, the file should not have any BOM because it is being 
converted to a string and is being passed to parseJSON(). I don't think 
parseJSON() expects a BOM either. Does it?

Ali



More information about the Digitalmars-d-learn mailing list