diff options
-rw-r--r-- | luni/src/main/native/libcore_icu_NativeIDN.cpp | 9 | ||||
-rw-r--r-- | luni/src/main/native/sub.mk | 3 |
2 files changed, 9 insertions, 3 deletions
diff --git a/luni/src/main/native/libcore_icu_NativeIDN.cpp b/luni/src/main/native/libcore_icu_NativeIDN.cpp index 16a6e1c..43f3ce5 100644 --- a/luni/src/main/native/libcore_icu_NativeIDN.cpp +++ b/luni/src/main/native/libcore_icu_NativeIDN.cpp @@ -39,9 +39,18 @@ static jstring NativeIDN_convertImpl(JNIEnv* env, jclass, jstring javaSrc, jint } UChar dst[256]; UErrorCode status = U_ZERO_ERROR; + + // We're stuck implementing IDNA-2003 for now since that's what we specify. + // + // TODO: Change our spec to IDNA-2008 + UTS-46 compatibility processing if + // it's safe enough. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" size_t resultLength = toAscii ? uidna_IDNToASCII(src.get(), src.size(), &dst[0], sizeof(dst), flags, NULL, &status) : uidna_IDNToUnicode(src.get(), src.size(), &dst[0], sizeof(dst), flags, NULL, &status); +#pragma GCC diagnostic pop + if (U_FAILURE(status)) { jniThrowException(env, "java/lang/IllegalArgumentException", u_errorName(status)); return NULL; diff --git a/luni/src/main/native/sub.mk b/luni/src/main/native/sub.mk index cf2118a..da866a6 100644 --- a/luni/src/main/native/sub.mk +++ b/luni/src/main/native/sub.mk @@ -64,6 +64,3 @@ LOCAL_STATIC_LIBRARIES += \ LOCAL_SHARED_LIBRARIES += \ liblog \ libnativehelper \ - -# Workaround to let libcore_icu_NativeIDN.cpp use the deprecated IDNA2003 API: -LOCAL_CFLAGS += -Wno-deprecated-declarations |