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

Side by Side Diff: net/base/escape_icu.cc

Issue 10444117: Escape search terms correctly in the path portion of a custom search engine. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/base/escape.cc ('k') | net/base/escape_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "net/base/escape.h"
6
7 #include "base/i18n/icu_string_conversions.h"
8 #include "base/utf_string_conversions.h"
9
10 // This file exists to avoid having escape.cc depend on ICU.
11
12 namespace net {
13
14 bool EscapeQueryParamValue(const string16& text,
15 const char* codepage,
16 bool use_plus,
17 string16* escaped) {
18 // TODO(brettw) bug 1201094: this function should be removed, this "SKIP"
19 // behavior is wrong when the character can't be encoded properly.
20 std::string encoded;
21 if (!base::UTF16ToCodepage(text, codepage,
22 base::OnStringConversionError::SKIP, &encoded))
23 return false;
24
25 escaped->assign(UTF8ToUTF16(EscapeQueryParamValue(encoded, use_plus)));
26 return true;
27 }
28
29 } // namespace net
OLDNEW
« no previous file with comments | « net/base/escape.cc ('k') | net/base/escape_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698