Internal change
PiperOrigin-RevId: 152820635
Change-Id: I5c47feb4ff9f3520e1b193eca5d8b4e0fca487fb
diff --git a/src/url/url_canon_icu.cc b/src/url/url_canon_icu.cc
index 70a2b27..95a4172 100644
--- a/src/url/url_canon_icu.cc
+++ b/src/url/url_canon_icu.cc
@@ -9,6 +9,7 @@
#include <string.h>
#include "base/logging.h"
+#include "third_party/icu/include/unicode/char16ptr.h"
#include "third_party/icu/include/unicode/ucnv.h"
#include "third_party/icu/include/unicode/ucnv_cb.h"
#include "third_party/icu/include/unicode/uidna.h"
@@ -133,7 +134,8 @@
UErrorCode err = U_ZERO_ERROR;
char* dest = &output->data()[begin_offset];
int required_capacity = ucnv_fromUChars(converter_, dest, dest_capacity,
- input, input_len, &err);
+ icu::ConstChar16Ptr(input),
+ input_len, &err);
if (err != U_BUFFER_OVERFLOW_ERROR) {
output->set_length(begin_offset + required_capacity);
return;
@@ -169,7 +171,9 @@
while (true) {
UErrorCode err = U_ZERO_ERROR;
UIDNAInfo info = UIDNA_INFO_INITIALIZER;
- int output_length = uidna_nameToASCII(uidna, src, src_len, output->data(),
+ int output_length = uidna_nameToASCII(uidna,
+ icu::ConstChar16Ptr(src), src_len,
+ icu::Char16Ptr(output->data()),
output->capacity(), &info, &err);
if (U_SUCCESS(err) && info.errors == 0) {
output->set_length(output_length);