summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-10 01:43:15 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-10 01:43:15 +0000
commit2500a0f7c4ac54a55d621069dc044ddc6702a518 (patch)
tree960a571bb2b49c9005fd152138e4398df9072854 /net
parent0d435eae98fbe4f8055215a7aa6c483b07b7fa03 (diff)
downloadchromium_src-2500a0f7c4ac54a55d621069dc044ddc6702a518.zip
chromium_src-2500a0f7c4ac54a55d621069dc044ddc6702a518.tar.gz
chromium_src-2500a0f7c4ac54a55d621069dc044ddc6702a518.tar.bz2
Clean up recent string conversion function changes, part 1: Remove unnecessary code. Thanks to a change in escape.cc I can basically revert the ICU conversions back to what they used to be; I can also get rid of half the conversions immediately since they aren't used.
This does not split out the "adjust" versions of the UTF conversions into their own header/implementation; that's coming in the next patch. BUG=4010 TEST=none Review URL: http://codereview.chromium.org/380007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31533 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/base/escape.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/base/escape.cc b/net/base/escape.cc
index 5196eb6..0327fc2 100644
--- a/net/base/escape.cc
+++ b/net/base/escape.cc
@@ -252,10 +252,10 @@ std::wstring UnescapeAndDecodeUTF8URLComponent(const std::string& text,
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