From 90f933a3b3ce799ebd2f1e04c8906ba0c6f514d9 Mon Sep 17 00:00:00 2001 From: "hbono@chromium.org" Date: Thu, 5 Mar 2009 03:41:51 +0000 Subject: Fixes Issue 7377: Regression: Omnibox trims URL ending with 0x85 (Take 2) This is the same change as "http://codereview.chromium.org/20219/show", which I reverted it because it caused build breaks on sandbox. To investigate this build break, it seems this build break is somehow caused by "base/string_util.cc" that includes the TrimWhiteSpaceUTF8() function. To fix this build break, I moved the TrimWhiteSpaceUTF8() function to "base/string_util_icu.cc". BUG=7377 Review URL: http://codereview.chromium.org/28310 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10970 0039d316-1c4b-4281-b951-d872f2087c98 --- base/string_util.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'base/string_util.cc') diff --git a/base/string_util.cc b/base/string_util.cc index 8f9bcf9..b37b483 100644 --- a/base/string_util.cc +++ b/base/string_util.cc @@ -381,8 +381,6 @@ const char kWhitespaceASCII[] = { 0x0C, 0x0D, 0x20, // Space - '\x85', // - '\xa0', // No-Break Space 0 }; const char* const kCodepageUTF8 = "UTF-8"; @@ -437,10 +435,18 @@ TrimPositions TrimWhitespace(const std::wstring& input, return TrimStringT(input, kWhitespaceWide, positions, output); } +TrimPositions TrimWhitespaceASCII(const std::string& input, + TrimPositions positions, + std::string* output) { + return TrimStringT(input, kWhitespaceASCII, positions, output); +} + +// This function is only for backward-compatibility. +// To be removed when all callers are updated. TrimPositions TrimWhitespace(const std::string& input, TrimPositions positions, std::string* output) { - return TrimStringT(input, kWhitespaceASCII, positions, output); + return TrimWhitespaceASCII(input, positions, output); } std::wstring CollapseWhitespace(const std::wstring& text, -- cgit v1.1