summaryrefslogtreecommitdiffstats
path: root/base/string_util.cc
diff options
context:
space:
mode:
authorhbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-26 10:21:49 +0000
committerhbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-26 10:21:49 +0000
commitb5df94ed369ac59a76e81fb8a13552cac449509f (patch)
tree90aa349879e8fe6ad8ee550aaea8556b8d3410b4 /base/string_util.cc
parent3ced98f4dad7b83de0d7b5f3fd9452c556799822 (diff)
downloadchromium_src-b5df94ed369ac59a76e81fb8a13552cac449509f.zip
chromium_src-b5df94ed369ac59a76e81fb8a13552cac449509f.tar.gz
chromium_src-b5df94ed369ac59a76e81fb8a13552cac449509f.tar.bz2
Reverting 10456.
Review URL: http://codereview.chromium.org/28180 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10458 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/string_util.cc')
-rw-r--r--base/string_util.cc26
1 files changed, 3 insertions, 23 deletions
diff --git a/base/string_util.cc b/base/string_util.cc
index 55be9df..4ba8c4b 100644
--- a/base/string_util.cc
+++ b/base/string_util.cc
@@ -337,6 +337,8 @@ const char kWhitespaceASCII[] = {
0x0C,
0x0D,
0x20, // Space
+ '\x85', // <control-0085>
+ '\xa0', // No-Break Space
0
};
const char* const kCodepageUTF8 = "UTF-8";
@@ -391,32 +393,10 @@ 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);
-}
-
-TrimPositions TrimWhitespaceUTF8(const std::string& input,
- TrimPositions positions,
- std::string* output) {
- // This implementation is not so fast since it converts the text encoding
- // twice. Please feel free to file a bug if this function hurts the
- // performance of Chrome.
- DCHECK(IsStringUTF8(input));
- std::wstring input_wide = UTF8ToWide(input);
- std::wstring output_wide;
- TrimPositions result = TrimWhitespace(input_wide, positions, &output_wide);
- *output = WideToUTF8(output_wide);
- return result;
-}
-
-// 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 TrimWhitespaceASCII(input, positions, output);
+ return TrimStringT(input, kWhitespaceASCII, positions, output);
}
std::wstring CollapseWhitespace(const std::wstring& text,