Re: [go-nuts] Re: Ignoring UTF-8 BOM when decoding JSON

2016-09-23 Thread Ian Davis
On Fri, Sep 23, 2016, at 03:35 PM, gary.willoug...@victoriaplumb.com wrote: > Yeah, the Json decoder should handle it. Maybe post a bug report? > https://github.com/golang/go/issues This has been raised before: https://github.com/golang/go/issues/12254 The answer is to use a reader to strip the

[go-nuts] Re: Ignoring UTF-8 BOM when decoding JSON

2016-09-23 Thread gary . willoughby
Yeah, the Json decoder should handle it. Maybe post a bug report? https://github.com/golang/go/issues On Friday, 23 September 2016 15:21:13 UTC+1, Mark Richman wrote: > > This works great, thanks! https://github.com/spkg/bom > > Agreed, JSON should not have BOM, however there is still software

[go-nuts] Re: Ignoring UTF-8 BOM when decoding JSON

2016-09-23 Thread Mark Richman
This works great, thanks! https://github.com/spkg/bom Agreed, JSON should not have BOM, however there is still software out there, especially on Windows, which insist on writing out JSON with the BOM. So, I have to account for it, standard or not. On Friday, September 23, 2016 at 10:13:40 AM

[go-nuts] Re: Ignoring UTF-8 BOM when decoding JSON

2016-09-23 Thread gary . willoughby
This looks like a compounded error. First, Json should never have a BOM encoded within it. Second, it seems like the Go Json decoder doesn't account for the BOM if it is mistakenly encoded. Both are mentioned in the Json RFC: https://tools.ietf.org/html/rfc7159#section-8.1 On Friday, 23 Septem