summaryrefslogtreecommitdiffstats
path: root/net/base/net_util_win.cc
diff options
context:
space:
mode:
authorjungshik@google.com <jungshik@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-25 21:42:00 +0000
committerjungshik@google.com <jungshik@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-25 21:42:00 +0000
commitc9ec45429c64884c35f83b74131c0e3ae5b2bbe9 (patch)
tree39007373603b8e75f53fa5e4d0c1586b1a3a56b5 /net/base/net_util_win.cc
parent7e2fa03804bef4bff9c5bb941f2edf09b6d234c0 (diff)
downloadchromium_src-c9ec45429c64884c35f83b74131c0e3ae5b2bbe9.zip
chromium_src-c9ec45429c64884c35f83b74131c0e3ae5b2bbe9.tar.gz
chromium_src-c9ec45429c64884c35f83b74131c0e3ae5b2bbe9.tar.bz2
Add UTF-8 check for JSON deserializer.
Add tests for IsStringUTF8 Make IsStringUTF8 accept std::string/std::wstring rather than char*/wchar_t* Review URL: http://codereview.chromium.org/4268 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2610 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/net_util_win.cc')
-rw-r--r--net/base/net_util_win.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/base/net_util_win.cc b/net/base/net_util_win.cc
index 206f485..7ea217c 100644
--- a/net/base/net_util_win.cc
+++ b/net/base/net_util_win.cc
@@ -44,7 +44,7 @@ bool FileURLToFilePath(const GURL& url, std::wstring* file_path) {
path = UnescapeURLComponent(path,
UnescapeRule::SPACES | UnescapeRule::URL_SPECIAL_CHARS);
- if (!IsStringUTF8(path.c_str())) {
+ if (!IsStringUTF8(path)) {
// Not UTF-8, assume encoding is native codepage and we're done. We know we
// are giving the conversion function a nonempty string, and it may fail if
// the given string is not in the current encoding and give us an empty
@@ -68,7 +68,7 @@ bool FileURLToFilePath(const GURL& url, std::wstring* file_path) {
NOTREACHED() << "Should have filtered out non-8-bit strings above.";
return false;
}
- if (IsStringUTF8(narrow.c_str())) {
+ if (IsStringUTF8(narrow)) {
// Our string actually looks like it could be UTF-8, convert to 8-bit
// UTF-8 and then to the corresponding wide string.
*file_path = UTF8ToWide(narrow);