ext/oj/load.c in oj-1.4.5 vs ext/oj/load.c in oj-1.4.6a2

- old
+ new

@@ -1007,9 +1007,13 @@ struct _ParseInfo pi; if (0 == json) { raise_error("Invalid arg, xml string can not be null", json, 0); } + /* skip UTF-8 BOM if present */ + if (0xEF == (uint8_t)*json && 0xBB == (uint8_t)json[1] && 0xBF == (uint8_t)json[2]) { + json += 3; + } /* initialize parse info */ pi.str = json; pi.s = json; pi.circ_array = 0; if (Yes == options->circular) {