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

Unified Diff: net/base/escape.cc

Issue 380007: Clean up recent string conversion function changes, part 1: Remove unnecessar... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 1 month 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/utf_string_conversions_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/escape.cc
===================================================================
--- net/base/escape.cc (revision 31509)
+++ net/base/escape.cc (working copy)
@@ -252,10 +252,10 @@
size_t* offset_for_adjustment) {
std::wstring result;
size_t original_offset = offset_for_adjustment ? *offset_for_adjustment : 0;
- if (base::CodepageToWideAndAdjustOffset(
- UnescapeURLImpl(text, rules, offset_for_adjustment),
- "UTF-8", base::OnStringConversionError::FAIL, &result,
- offset_for_adjustment))
+ std::string unescaped_url(
+ UnescapeURLImpl(text, rules, offset_for_adjustment));
+ if (UTF8ToWideAndAdjustOffset(unescaped_url.data(), unescaped_url.length(),
+ &result, offset_for_adjustment))
return result; // Character set looks like it's valid.
// Not valid. Return the escaped version. Undo our changes to
« no previous file with comments | « base/utf_string_conversions_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698