1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-28 03:06:20 -04:00

Port ELinks to libidn2

Bug: https://bugzilla.redhat.com/1098789
This commit is contained in:
Robert Scheck 2022-04-11 09:39:48 +02:00 committed by Kamil Dudka
parent 2f6cac0243
commit b8ae8297e8
4 changed files with 10 additions and 10 deletions

View File

@ -139,7 +139,7 @@ CONFIG_GOPHER = @CONFIG_GOPHER@
CONFIG_GPM = @CONFIG_GPM@ CONFIG_GPM = @CONFIG_GPM@
CONFIG_GZIP = @CONFIG_GZIP@ CONFIG_GZIP = @CONFIG_GZIP@
CONFIG_HTML_HIGHLIGHT = @CONFIG_HTML_HIGHLIGHT@ CONFIG_HTML_HIGHLIGHT = @CONFIG_HTML_HIGHLIGHT@
CONFIG_IDN = @CONFIG_IDN@ CONFIG_IDN2 = @CONFIG_IDN2@
CONFIG_INTERLINK = @CONFIG_INTERLINK@ CONFIG_INTERLINK = @CONFIG_INTERLINK@
CONFIG_IPV6 = @CONFIG_IPV6@ CONFIG_IPV6 = @CONFIG_IPV6@
CONFIG_DBLATEX = @CONFIG_DBLATEX@ CONFIG_DBLATEX = @CONFIG_DBLATEX@

View File

@ -556,8 +556,8 @@ EL_LOG_CONFIG([CONFIG_BROTLI], [[brotli]], [[$enable_brotli]])
EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_LZMA, lzma, lzma.h, lzma, lzma_code, EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_LZMA, lzma, lzma.h, lzma, lzma_code,
[ --with-lzma enable lzma encoding support]) [ --with-lzma enable lzma encoding support])
EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_IDN, idn, idna.h, idn, stringprep_check_version, EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_IDN2, idn2, idn2.h, idn2, idn2_lookup_ul,
[ --without-idn disable international domain names support]) [ --without-idn2 disable international domain names support])
# =================================================================== # ===================================================================
# Check for GSSAPI, optional even if installed. # Check for GSSAPI, optional even if installed.

View File

@ -44,7 +44,7 @@ init_osdep(void)
} }
#endif #endif
setlocale(LC_ALL, ""); setlocale(LC_ALL, "");
#ifdef CONFIG_IDN #ifdef CONFIG_IDN2
{ {
char buf[60]; char buf[60];
UINT cp = GetACP(); UINT cp = GetACP();

View File

@ -9,8 +9,8 @@
#ifdef HAVE_ICONV #ifdef HAVE_ICONV
#include <iconv.h> #include <iconv.h>
#endif #endif
#ifdef HAVE_IDNA_H #ifdef HAVE_IDN2_H
#include <idna.h> #include <idn2.h>
#endif #endif
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@ -535,10 +535,10 @@ add_uri_to_string(struct string *string, const struct uri *uri,
* --pasky */ * --pasky */
if (uri->ipv6 && wants(URI_PORT)) add_char_to_string(string, '['); if (uri->ipv6 && wants(URI_PORT)) add_char_to_string(string, '[');
#endif #endif
#ifdef CONFIG_IDN #ifdef CONFIG_IDN2
/* Support for the GNU International Domain Name library. /* Support for the GNU International Domain Name library.
* *
* http://www.gnu.org/software/libidn/manual/html_node/IDNA-Functions.html * http://www.gnu.org/software/libidn/libidn2/manual/libidn2.html
*/ */
if (wants(URI_IDN)) { if (wants(URI_IDN)) {
char *host = NULL; char *host = NULL;
@ -556,10 +556,10 @@ add_uri_to_string(struct string *string, const struct uri *uri,
if (host) { if (host) {
char *idname; char *idname;
int code = idna_to_ascii_8z(host, &idname, 0); int code = idn2_lookup_ul(host, &idname, 0);
/* FIXME: Return NULL if it coughed? --jonas */ /* FIXME: Return NULL if it coughed? --jonas */
if (code == IDNA_SUCCESS) { if (code == IDN2_OK) {
add_to_string(string, idname); add_to_string(string, idname);
free(idname); free(idname);
add_host = 0; add_host = 0;