Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Unified Diff: net/base/net_util.cc

Issue 4268: IsStringUTF8 unittest and enforcing UTF-8 in JSON deserialization (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/string_util_unittest.cc ('k') | net/base/net_util_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/net_util.cc
===================================================================
--- net/base/net_util.cc (revision 2506)
+++ net/base/net_util.cc (working copy)
@@ -237,7 +237,7 @@
// UTF-16 assuming it's in the OS default encoding.
if (!IsStringASCII(encoded_word)) {
// Try falling back to the NativeMB encoding if the raw input is not UTF-8.
- if (IsStringUTF8(encoded_word.c_str())) {
+ if (IsStringUTF8(encoded_word)) {
*output = encoded_word;
} else {
*output = WideToUTF8(base::SysNativeMBToWide(encoded_word));
@@ -328,7 +328,7 @@
// support a rudimentary form of RFC 2231 with charset label, but
// it'd gain us little in terms of compatibility.
tmp = UnescapeURLComponent(encoded_word, UnescapeRule::SPACES);
- if (IsStringUTF8(tmp.c_str())) {
+ if (IsStringUTF8(tmp)) {
output->swap(tmp);
return true;
// We can try either the OS default charset or 'origin charset' here,
« no previous file with comments | « base/string_util_unittest.cc ('k') | net/base/net_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698