Mongoimport now fails on invalid UTF8 SERVER-1171

This commit is contained in:
Mathias Stearn
2010-06-03 15:52:22 -04:00
parent 73b955c267
commit 7fc82df75e

View File

@@ -21,6 +21,7 @@
#include "db/json.h"
#include "tool.h"
#include "../util/text.h"
#include <fstream>
#include <iostream>
@@ -53,6 +54,8 @@ class Import : public Tool {
}
BSONObj parseLine( char * line ){
uassert(13289, "Invalid UTF8 character detected", isValidUTF8(line));
if ( _type == JSON ){
char * end = ( line + strlen( line ) ) - 1;
while ( isspace(*end) ){