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

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

Issue 112963005: Update uses of UTF conversions in courgette/, device/, extensions/, google_apis/, gpu/, ipc/, media… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 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/net_util_unittest.cc ('k') | net/base/network_time_notifier.cc » ('j') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "net/base/net_util.h" 5 #include "net/base/net_util.h"
6 6
7 #include <iphlpapi.h> 7 #include <iphlpapi.h>
8 #include <wlanapi.h> 8 #include <wlanapi.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 UnescapeRule::SPACES | UnescapeRule::URL_SPECIAL_CHARS); 120 UnescapeRule::SPACES | UnescapeRule::URL_SPECIAL_CHARS);
121 121
122 if (!IsStringUTF8(path)) { 122 if (!IsStringUTF8(path)) {
123 // Not UTF-8, assume encoding is native codepage and we're done. We know we 123 // Not UTF-8, assume encoding is native codepage and we're done. We know we
124 // are giving the conversion function a nonempty string, and it may fail if 124 // are giving the conversion function a nonempty string, and it may fail if
125 // the given string is not in the current encoding and give us an empty 125 // the given string is not in the current encoding and give us an empty
126 // string back. We detect this and report failure. 126 // string back. We detect this and report failure.
127 file_path_str = base::SysNativeMBToWide(path); 127 file_path_str = base::SysNativeMBToWide(path);
128 return !file_path_str.empty(); 128 return !file_path_str.empty();
129 } 129 }
130 file_path_str.assign(UTF8ToWide(path)); 130 file_path_str.assign(base::UTF8ToWide(path));
131 131
132 // We used to try too hard and see if |path| made up entirely of 132 // We used to try too hard and see if |path| made up entirely of
133 // the 1st 256 characters in the Unicode was a zero-extended UTF-16. 133 // the 1st 256 characters in the Unicode was a zero-extended UTF-16.
134 // If so, we converted it to 'Latin-1' and checked if the result was UTF-8. 134 // If so, we converted it to 'Latin-1' and checked if the result was UTF-8.
135 // If the check passed, we converted the result to UTF-8. 135 // If the check passed, we converted the result to UTF-8.
136 // Otherwise, we treated the result as the native OS encoding. 136 // Otherwise, we treated the result as the native OS encoding.
137 // However, that led to http://crbug.com/4619 and http://crbug.com/14153 137 // However, that led to http://crbug.com/4619 and http://crbug.com/14153
138 return true; 138 return true;
139 } 139 }
140 140
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 case dot11_phy_type_erp: 306 case dot11_phy_type_erp:
307 return WIFI_PHY_LAYER_PROTOCOL_G; 307 return WIFI_PHY_LAYER_PROTOCOL_G;
308 case dot11_phy_type_ht: 308 case dot11_phy_type_ht:
309 return WIFI_PHY_LAYER_PROTOCOL_N; 309 return WIFI_PHY_LAYER_PROTOCOL_N;
310 default: 310 default:
311 return WIFI_PHY_LAYER_PROTOCOL_UNKNOWN; 311 return WIFI_PHY_LAYER_PROTOCOL_UNKNOWN;
312 } 312 }
313 } 313 }
314 314
315 } // namespace net 315 } // namespace net
OLDNEW
« no previous file with comments | « net/base/net_util_unittest.cc ('k') | net/base/network_time_notifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698