about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2021-07-09 00:27:04 +0000
committerThomas E. Dickey <dickey@invisible-island.net>2021-07-09 00:27:04 +0000
commitcc4054129b8ce4043e8ab2a701e795827bdb2e0a (patch)
treedbba1868596f149e11d3b76a58a6fb41432adbe8 /src
parent35787b45f4cbf08d6e4d913e859a39a4e4369766 (diff)
downloadlynx-snapshots-cc4054129b8ce4043e8ab2a701e795827bdb2e0a.tar.gz
snapshot of project "lynx", label v2-9-0dev_6m
Diffstat (limited to 'src')
-rw-r--r--src/LYMain.c5
-rw-r--r--src/LYOptions.c39
-rw-r--r--src/LYrcFile.c16
-rw-r--r--src/LYrcFile.h7
4 files changed, 58 insertions, 9 deletions
diff --git a/src/LYMain.c b/src/LYMain.c
index 14e015ec..af78ef78 100644
--- a/src/LYMain.c
+++ b/src/LYMain.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYMain.c,v 1.293 2021/06/09 20:55:53 tom Exp $
+ * $LynxId: LYMain.c,v 1.295 2021/07/05 20:26:11 tom Exp $
  */
 #include <HTUtils.h>
 #include <HTTP.h>
@@ -178,6 +178,9 @@ lynx_list_item_type *externals = NULL;
 
 			    /* linked list of external options */
 #endif
+#ifdef USE_IDN2
+int LYidnaMode = LYidnaTR46;
+#endif
 
 lynx_list_item_type *uploaders = NULL;
 int LYShowColor = SHOW_COLOR_UNKNOWN;	/* to show or not */
diff --git a/src/LYOptions.c b/src/LYOptions.c
index 698224ca..9208d994 100644
--- a/src/LYOptions.c
+++ b/src/LYOptions.c
@@ -1,4 +1,4 @@
-/* $LynxId: LYOptions.c,v 1.182 2020/01/21 21:36:31 tom Exp $ */
+/* $LynxId: LYOptions.c,v 1.183 2021/07/05 21:17:42 tom Exp $ */
 #include <HTUtils.h>
 #include <HTFTP.h>
 #include <HTTP.h>		/* 'reloading' flag */
@@ -2367,6 +2367,18 @@ static const char *assume_char_set_string = RC_ASSUME_CHARSET;
 static const char *display_char_set_string = RC_CHARACTER_SET;
 static const char *raw_mode_string = RC_RAW_MODE;
 
+#ifdef USE_IDN2
+static const char *idna_mode_string = RC_IDNA_MODE;
+static OptValues idna_values[] =
+{
+    {LYidna2003, N_("IDNA 2003"), "idna2003"},
+    {LYidna2008, N_("IDNA 2008"), "idna2008"},
+    {LYidnaTR46, N_("IDNA TR46"), "idnaTR46"},
+    {LYidnaCompat, N_("IDNA Compatible"), "idnaCompat"},
+    END_OPTIONS
+};
+#endif
+
 #ifdef USE_LOCALE_CHARSET
 static const char *locale_charset_string = RC_LOCALE_CHARSET;
 #endif
@@ -3248,6 +3260,13 @@ int postoptions(DocInfo *newdoc)
 		    current_char_set = newval;
 	    }
 	}
+#ifdef USE_IDN2
+	/* Internationalized Domain Names: SELECT */
+	if (!strcmp(data[i].tag, idna_mode_string)
+	    && GetOptValues(idna_values, data[i].value, &code)) {
+	    LYidnaMode = code;
+	}
+#endif
 
 	/* Raw Mode: ON/OFF */
 	if (!strcmp(data[i].tag, raw_mode_string)
@@ -3418,9 +3437,7 @@ int postoptions(DocInfo *newdoc)
 	need_reload = TRUE;
     }
     /* end of charset settings */
-    /*
-     * FIXME: Golly gee, we need to write all of this out now, don't we?
-     */
+
     BStrFree(newdoc->post_data);
     FREE(data);
     if (save_all) {
@@ -3954,6 +3971,20 @@ static int gen_options(char **newfile)
 	EndSelect(fp0);
     }
 
+#ifdef USE_IDN2
+    /* Internationalized Domain Names: SELECT */
+    {
+	PutLabel(fp0, gettext("Internationalized domain names"), idna_mode_string);
+	BeginSelect(fp0, idna_mode_string);
+	for (i = 0; idna_values[i].value != 0; i++) {
+	    PutOption(fp0, idna_values[i].value == LYidnaMode,
+		      idna_values[i].HtmlName,
+		      idna_values[i].LongName);
+	}
+	EndSelect(fp0);
+    }
+#endif
+
     /* Raw Mode: ON/OFF */
     if (LYHaveCJKCharacterSet) {
 	/*
diff --git a/src/LYrcFile.c b/src/LYrcFile.c
index 8cdec2b4..06b843a5 100644
--- a/src/LYrcFile.c
+++ b/src/LYrcFile.c
@@ -1,4 +1,4 @@
-/* $LynxId: LYrcFile.c,v 1.104 2019/01/25 01:47:06 tom Exp $ */
+/* $LynxId: LYrcFile.c,v 1.105 2021/07/05 20:29:10 tom Exp $ */
 #include <HTUtils.h>
 #include <HTFTP.h>
 #include <LYUtils.h>
@@ -71,6 +71,16 @@ static Config_Enum tbl_file_sort[] = {
     { NULL,		-1 },
 };
 
+#ifdef USE_IDN2
+static Config_Enum tbl_idna_mode[] = {
+    { "IDNA2003",	LYidna2003 },
+    { "IDNA2008",	LYidna2008 },
+    { "TR46",		LYidnaTR46 },
+    { "Compatible",	LYidnaCompat },
+    { NULL,		-1 },
+};
+#endif
+
 Config_Enum tbl_keypad_mode[] = {
     { "FIELDS_ARE_NUMBERED", FIELDS_ARE_NUMBERED },
     { "LINKS_AND_FIELDS_ARE_NUMBERED", LINKS_AND_FIELDS_ARE_NUMBERED },
@@ -471,6 +481,10 @@ file lists such as FTP directories.  The options are:\n\
     MAYBE_SET(RC_HTML5_CHARSETS,        html5_charsets,     MSG_ENABLE_LYNXRC),
     MAYBE_FUN(RC_HTTP_PROTOCOL,         get_http_protocol,  put_http_protocol,
 	      MSG_ENABLE_LYNXRC),
+#ifdef USE_IDN2
+    MAYBE_ENU(RC_IDNA_MODE,             LYidnaMode,         tbl_idna_mode,
+	      MSG_ENABLE_LYNXRC),
+#endif
 #ifdef EXP_KEYBOARD_LAYOUT
     PARSE_ARY(RC_KBLAYOUT,              current_layout,     LYKbLayoutNames, NULL),
 #endif
diff --git a/src/LYrcFile.h b/src/LYrcFile.h
index da45fbf3..f23c87ff 100644
--- a/src/LYrcFile.h
+++ b/src/LYrcFile.h
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYrcFile.h,v 1.56 2020/02/23 23:08:55 Keith.Bowes Exp $
+ * $LynxId: LYrcFile.h,v 1.58 2021/07/05 20:23:51 tom Exp $
  */
 #ifndef LYRCFILE_H
 #define LYRCFILE_H
@@ -99,8 +99,8 @@
 #define RC_GLOBAL_MAILCAP               "global_mailcap"
 #define RC_GOPHER_PROXY                 "gopher_proxy"
 #define RC_GOTOBUFFER                   "gotobuffer"
-#define RC_GZIP_PATH                    "gzip_path"
 #define RC_GUESS_SCHEME                 "guess_scheme"
+#define RC_GZIP_PATH                    "gzip_path"
 #define RC_HELPFILE                     "helpfile"
 #define RC_HIDDENLINKS                  "hiddenlinks"
 #define RC_HIDDEN_LINK_MARKER           "hidden_link_marker"
@@ -111,6 +111,7 @@
 #define RC_HTTPS_PROXY                  "https_proxy"
 #define RC_HTTP_PROTOCOL                "http_protocol"
 #define RC_HTTP_PROXY                   "http_proxy"
+#define RC_IDNA_MODE                    "idna_mode"
 #define RC_INCLUDE                      "include"
 #define RC_INFLATE_PATH                 "inflate_path"
 #define RC_INFOSECS                     "infosecs"
@@ -179,7 +180,6 @@
 #define RC_NO_REFERER_HEADER            "no_referer_header"
 #define RC_NO_TABLE_CENTER              "no_table_center"
 #define RC_NO_TITLE                     "no_title"
-#define RC_UPDATE_TERM_TITLE            "update_term_title"
 #define RC_NUMBER_FIELDS_ON_LEFT        "number_fields_on_left"
 #define RC_NUMBER_LINKS_ON_LEFT         "number_links_on_left"
 #define RC_OUTGOING_MAIL_CHARSET        "outgoing_mail_charset"
@@ -271,6 +271,7 @@
 #define RC_UNDERLINE_LINKS              "underline_links"
 #define RC_UNIQUE_URLS                  "unique_urls"
 #define RC_UNZIP_PATH                   "unzip_path"
+#define RC_UPDATE_TERM_TITLE            "update_term_title"
 #define RC_UPLOADER                     "uploader"
 #define RC_URL_DOMAIN_PREFIXES          "url_domain_prefixes"
 #define RC_URL_DOMAIN_SUFFIXES          "url_domain_suffixes"