OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // ICU integration functions. | 5 // ICU integration functions. |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "third_party/icu/public/common/unicode/ucnv.h" | 11 #include "third_party/icu/source/common/unicode/ucnv.h" |
12 #include "third_party/icu/public/common/unicode/ucnv_cb.h" | 12 #include "third_party/icu/source/common/unicode/ucnv_cb.h" |
13 #include "third_party/icu/public/common/unicode/uidna.h" | 13 #include "third_party/icu/source/common/unicode/uidna.h" |
14 #include "url/url_canon_icu.h" | 14 #include "url/url_canon_icu.h" |
15 #include "url/url_canon_internal.h" // for _itoa_s | 15 #include "url/url_canon_internal.h" // for _itoa_s |
16 | 16 |
17 namespace url_canon { | 17 namespace url_canon { |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 // Called when converting a character that can not be represented, this will | 21 // Called when converting a character that can not be represented, this will |
22 // append an escaped version of the numerical character reference for that code | 22 // append an escaped version of the numerical character reference for that code |
23 // point. It is of the form "Ӓ" and we will escape the non-digits to | 23 // point. It is of the form "Ӓ" and we will escape the non-digits to |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 | 175 |
176 if (U_IS_UNICODE_CHAR(*code_point)) | 176 if (U_IS_UNICODE_CHAR(*code_point)) |
177 return true; | 177 return true; |
178 | 178 |
179 // Invalid code point. | 179 // Invalid code point. |
180 *code_point = kUnicodeReplacementCharacter; | 180 *code_point = kUnicodeReplacementCharacter; |
181 return false; | 181 return false; |
182 } | 182 } |
183 | 183 |
184 } // namespace url_canon | 184 } // namespace url_canon |
OLD | NEW |