mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
ignore UTF-8 BOM in mongoimport SERVER-862
This commit is contained in:
parent
fa7e909e5e
commit
2e6c1584c0
@ -271,6 +271,11 @@ public:
|
||||
(!(in->rdstate() & ios_base::failbit) || (in->rdstate() & ios_base::eofbit)) );
|
||||
|
||||
int len = 0;
|
||||
if (strncmp("\xEF\xBB\xBF", buf, 3) == 0){ // UTF-8 BOM (notepad is stupid)
|
||||
buf += 3;
|
||||
len += 3;
|
||||
}
|
||||
|
||||
if (_jsonArray){
|
||||
while (buf[0] != '{' && buf[0] != '\0') {
|
||||
len++;
|
||||
|
Loading…
Reference in New Issue
Block a user