Index: base/json_reader.cc |
=================================================================== |
--- base/json_reader.cc (revision 2506) |
+++ base/json_reader.cc (working copy) |
@@ -83,8 +83,11 @@ |
Value** root, |
bool check_root, |
bool allow_trailing_comma) { |
- // Assume input is UTF8. The conversion from UTF8 to wstring removes null |
- // bytes for us (a good thing). |
+ // The input must be in UTF-8. |
+ if (!IsStringUTF8(json.c_str())) |
+ return false; |
+ // The conversion from UTF8 to wstring removes null bytes for us |
+ // (a good thing). |
std::wstring json_wide(UTF8ToWide(json)); |
const wchar_t* json_cstr = json_wide.c_str(); |