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

Unified Diff: base/string_util_icu.cc

Issue 28310: Fixes Issue 7377: Regression: Omnibox trims URL ending with 0x85 (Take 2)... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 months 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/string_util.cc ('k') | base/string_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/string_util_icu.cc
===================================================================
--- base/string_util_icu.cc (revision 10694)
+++ base/string_util_icu.cc (working copy)
@@ -530,3 +530,17 @@
#endif // defined(WCHAR_T_IS_UTF32)
}
+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;
+}
+
« no previous file with comments | « base/string_util.cc ('k') | base/string_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698