xiaokang commented on code in PR #18585:
URL: https://github.com/apache/doris/pull/18585#discussion_r1164946357
##########
be/src/vec/exec/format/json/new_json_reader.cpp:
##########
@@ -1549,6 +1552,13 @@ Status NewJsonReader::_simdjson_parse_json_doc(size_t*
size, bool* eof) {
_simdjson_ondemand_padding_buffer.resize(*size +
simdjson::SIMDJSON_PADDING);
_padded_size = *size + simdjson::SIMDJSON_PADDING;
}
+ // trim BOM since simdjson does not handle UTF-8 Unicode (with BOM)
+ if (*size >= 3 && static_cast<char>(json_str[0]) == '\xEF' &&
Review Comment:
There are some more cases for BOM.
https://learn.microsoft.com/en-us/globalization/encoding/byte-order-mark
https://www.cnblogs.com/qinmengjiao123-123/p/8325646.html
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]