URL-Google-GURL
view release on metacpan or search on metacpan
src/googleurl/src/url_canon_icu.cc view on Meta::CPAN
UErrorCode err = U_ZERO_ERROR;
char* dest = &output->data()[begin_offset];
int required_capacity = ucnv_fromUChars(converter_, dest, dest_capacity,
input, input_len, &err);
if (err != U_BUFFER_OVERFLOW_ERROR) {
output->set_length(begin_offset + required_capacity);
return;
}
// Output didn't fit, expand
dest_capacity = required_capacity;
output->Resize(begin_offset + dest_capacity);
} while (true);
}
// Converts the Unicode input representing a hostname to ASCII using IDN rules.
// The output must be ASCII, but is represented as wide characters.
//
// On success, the output will be filled with the ASCII host name and it will
// return true. Unlike most other canonicalization functions, this assumes that
// the output is empty. The beginning of the host will be at offset 0, and
( run in 0.395 second using v1.01-cache-2.11-cpan-05444aca049 )