You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
vlc/SOURCES/libidn2.patch

50 lines
1.4 KiB

diff --git a/configure.ac b/configure.ac
index 78b9ce2..b9c1563 100644
--- a/configure.ac
+++ b/configure.ac
@@ -910,9 +910,9 @@ AM_CONDITIONAL(HAVE_MINIZIP, [ test "${have_minizip}" = "yes" ])
dnl
-dnl Domain name i18n support via GNU libidn
+dnl Domain name i18n support via GNU libidn2
dnl
-PKG_CHECK_MODULES([IDN], [libidn], [
+PKG_CHECK_MODULES([IDN], [libidn2], [
have_libidn="yes"
AC_DEFINE([HAVE_IDN], 1, [Define to 1 if you have GNU libidn.])
], [
diff --git a/src/text/url.c b/src/text/url.c
index 2eb4b8d..467b7f3 100644
--- a/src/text/url.c
+++ b/src/text/url.c
@@ -873,7 +873,7 @@ char *vlc_uri_fixup(const char *str)
}
#if defined (HAVE_IDN)
-# include <idna.h>
+# include <idn2.h>
#elif defined (_WIN32)
# include <windows.h>
# include <vlc_charset.h>
@@ -914,16 +914,13 @@ static char *vlc_idna_to_ascii (const char *idn)
#if defined (HAVE_IDN)
char *adn;
- switch (idna_to_ascii_8z(idn, &adn, IDNA_ALLOW_UNASSIGNED))
+ switch (idn2_to_ascii_8z(idn, &adn, IDN2_ALLOW_UNASSIGNED|IDN2_NFC_INPUT|IDN2_NONTRANSITIONAL))
{
- case IDNA_SUCCESS:
+ case IDN2_OK:
return adn;
- case IDNA_MALLOC_ERROR:
+ case IDN2_MALLOC:
errno = ENOMEM;
return NULL;
- case IDNA_DLOPEN_ERROR:
- errno = ENOSYS;
- return NULL;
default:
errno = EINVAL;
return NULL;