Index: third_party/WebKit/Source/core/html/forms/EmailInputType.cpp |
diff --git a/third_party/WebKit/Source/core/html/forms/EmailInputType.cpp b/third_party/WebKit/Source/core/html/forms/EmailInputType.cpp |
index 755ae39ddb5aa61af50616607431d2c6bdadbf52..52be833b101f4f6c5b1a01ad011a3c126ee20f67 100644 |
--- a/third_party/WebKit/Source/core/html/forms/EmailInputType.cpp |
+++ b/third_party/WebKit/Source/core/html/forms/EmailInputType.cpp |
@@ -23,6 +23,9 @@ |
#include "core/html/forms/EmailInputType.h" |
+#include <unicode/idna.h> |
+#include <unicode/unistr.h> |
+#include <unicode/uvernum.h> |
#include "bindings/core/v8/ScriptRegexp.h" |
#include "core/InputTypeNames.h" |
#include "core/html/HTMLInputElement.h" |
@@ -31,8 +34,10 @@ |
#include "platform/text/PlatformLocale.h" |
#include "public/platform/Platform.h" |
#include "wtf/text/StringBuilder.h" |
-#include <unicode/idna.h> |
-#include <unicode/unistr.h> |
+ |
+#if U_ICU_VERSION_MAJOR_NUM >= 59 |
+#include <unicode/char16ptr.h> |
+#endif |
namespace blink { |
@@ -87,7 +92,11 @@ String EmailInputType::convertEmailAddressToASCII(const ScriptRegexp& regexp, |
StringBuilder builder; |
builder.append(address, 0, atPosition + 1); |
+#if U_ICU_VERSION_MAJOR_NUM >= 59 |
+ builder.append(icu::toUCharPtr(domainName.getBuffer()), domainName.length()); |
+#else |
builder.append(domainName.getBuffer(), domainName.length()); |
+#endif |
String asciiEmail = builder.toString(); |
return isValidEmailAddress(regexp, asciiEmail) ? asciiEmail : address; |
} |