1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
description: backwards compatibility for older versions of icu
author: Michael Gilbert <mgilbert@debian.org>
--- a/third_party/blink/renderer/platform/graphics/logging_canvas.cc
+++ b/third_party/blink/renderer/platform/graphics/logging_canvas.cc
@@ -530,8 +530,12 @@ String StringForUTF32LEText(const void*
utf16 = icu::UnicodeString::fromUTF32(reinterpret_cast<const UChar32*>(text),
static_cast<int32_t>(byte_length));
#endif
+#if U_ICU_VERSION_MAJOR_NUM >= 59
return String(icu::toUCharPtr(utf16.getBuffer()),
static_cast<unsigned>(utf16.length()));
+#else
+ return String(utf16.getBuffer(),static_cast<unsigned>(utf16.length()));
+#endif
}
String StringForText(const void* text,
--- a/net/BUILD.gn
+++ b/net/BUILD.gn
@@ -11,7 +11,6 @@ import("//build/config/ui.gni")
import("//net/features.gni")
import("//testing/libfuzzer/fuzzer_test.gni")
import("//testing/test.gni")
-import("//third_party/icu/config.gni")
import("//third_party/protobuf/proto_library.gni")
import("//tools/grit/grit_rule.gni")
import("//url/features.gni")
--- a/components/url_formatter/idn_spoof_checker.cc
+++ b/components/url_formatter/idn_spoof_checker.cc
@@ -394,8 +394,8 @@ Skeletons IDNSpoofChecker::GetSkeletons(
if ((u04cf_pos = host.indexOf(0x4CF)) != -1) {
icu::UnicodeString host_alt(host);
size_t length = host_alt.length();
- char16_t* buffer = host_alt.getBuffer(-1);
- for (char16_t* uc = buffer + u04cf_pos; uc < buffer + length; ++uc) {
+ UChar* buffer = host_alt.getBuffer(-1);
+ for (UChar* uc = buffer + u04cf_pos; uc < buffer + length; ++uc) {
if (*uc == 0x4CF)
*uc = 0x6C; // Lowercase L
}
|