OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/string_piece.h" | 8 #include "base/string_piece.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
| 11 #include "base/utf_string_conversions.h" |
11 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
12 #include "net/base/escape.h" | 13 #include "net/base/escape.h" |
13 | 14 |
14 namespace net { | 15 namespace net { |
15 | 16 |
16 bool FileURLToFilePath(const GURL& url, FilePath* file_path) { | 17 bool FileURLToFilePath(const GURL& url, FilePath* file_path) { |
17 *file_path = FilePath(); | 18 *file_path = FilePath(); |
18 std::wstring& file_path_str = const_cast<std::wstring&>(file_path->value()); | 19 std::wstring& file_path_str = const_cast<std::wstring&>(file_path->value()); |
19 file_path_str.clear(); | 20 file_path_str.clear(); |
20 | 21 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 // We used to try too hard and see if |path| made up entirely of | 61 // We used to try too hard and see if |path| made up entirely of |
61 // the 1st 256 characters in the Unicode was a zero-extended UTF-16. | 62 // the 1st 256 characters in the Unicode was a zero-extended UTF-16. |
62 // If so, we converted it to 'Latin-1' and checked if the result was UTF-8. | 63 // If so, we converted it to 'Latin-1' and checked if the result was UTF-8. |
63 // If the check passed, we converted the result to UTF-8. | 64 // If the check passed, we converted the result to UTF-8. |
64 // Otherwise, we treated the result as the native OS encoding. | 65 // Otherwise, we treated the result as the native OS encoding. |
65 // However, that led to http://crbug.com/4619 and http://crbug.com/14153 | 66 // However, that led to http://crbug.com/4619 and http://crbug.com/14153 |
66 return true; | 67 return true; |
67 } | 68 } |
68 | 69 |
69 } // namespace net | 70 } // namespace net |
OLD | NEW |