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 UTC-4, 
gary.wi...@victoriaplumb.com wrote:
>
> 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 September 2016 12:37:56 UTC+1, Mark Richman wrote:
>>
>> I have a JSON file which begins with the UTF-8 byte-order marker (BOM) 
>> 0xEF 0xBB 0xBF.
>>
>> This causes Decode() to fail with SyntaxError:
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to