aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-09-11 00:40:30 +0200
committerKim Alvefur <zash@zash.se>2019-09-11 00:40:30 +0200
commitbf1a0c2f0577c980394830a346a2637694ae2057 (patch)
tree97487498e789b2a1f596db9eab5ff901bb021a84
parentbb4cb60fb8200e5fa26eaa482422fbbfa71aa11c (diff)
downloadprosody-bf1a0c2f0577c980394830a346a2637694ae2057.tar.gz
prosody-bf1a0c2f0577c980394830a346a2637694ae2057.zip
util.encodings: Spell out all IDNA 2008 options ICU has
-rw-r--r--util-src/encodings.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/util-src/encodings.c b/util-src/encodings.c
index f20ba75d..6f2676f2 100644
--- a/util-src/encodings.c
+++ b/util-src/encodings.c
@@ -341,7 +341,30 @@ void init_icu(void) {
icu_saslprep = usprep_openByType(USPREP_RFC4013_SASLPREP, &err);
icu_spoofcheck = uspoof_open(&err);
uspoof_setChecks(icu_spoofcheck, USPOOF_CONFUSABLE, &err);
- icu_idna2008 = uidna_openUTS46(UIDNA_USE_STD3_RULES, &err);
+ int options = UIDNA_DEFAULT;
+#if 0
+ /* COMPAT with future Unicode versions */
+ options |= UIDNA_ALLOW_UNASSIGNED;
+#endif
+#if 1
+ /* Forbid eg labels starting with _ */
+ options |= UIDNA_USE_STD3_RULES;
+#endif
+#if 0
+ /* TODO determine if we need this */
+ options |= UIDNA_CHECK_BIDI;
+#endif
+#if 0
+ /* UTS46 makes it sound like these are the responsibility of registrars */
+ options |= UIDNA_CHECK_CONTEXTJ;
+ options |= UIDNA_CHECK_CONTEXTO;
+#endif
+#if 0
+ /* This disables COMPAT with IDNA 2003 */
+ options |= UIDNA_NONTRANSITIONAL_TO_ASCII;
+ options |= UIDNA_NONTRANSITIONAL_TO_UNICODE;
+#endif
+ icu_idna2008 = uidna_openUTS46(options, &err);
if(U_FAILURE(err)) {
fprintf(stderr, "[c] util.encodings: error: %s\n", u_errorName((UErrorCode)err));