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

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

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

Powered by Google App Engine
This is Rietveld 408576698