summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-10-29 12:17:40 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-10-29 13:02:40 +0000
commita346dfccd7e342d776dd59eb3ed128557e22a1bf (patch)
treefd2b7dcb940e054bdc080afed3b52257c9e4ca84 /include
parentb051510796dcf289edcd03737087176e53bbe4b8 (diff)
tdf#70833: IDNA support when exporing hyperlinks to PDF
Any URLs using non-ASCII IDNA syntax need to be resolved to ASCII-only, as PDF URI Action's URI needs to be "encoded in 7-bit ASCII." Introduce URIHelper::resolveIdnaHost (svl/urihelper.hxx), which internally uses icu::IDNA, which requires to bump the minimal --with-system-icu requirement from 4.2 to 4.6, which means ICU_RECLASSIFIED_CLOSE_PARENTHESIS is always true now. Change-Id: I0e20d9a20ed2b869fba0cc7c969721411db590b3 Reviewed-on: https://gerrit.libreoffice.org/19669 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/svl/urihelper.hxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/svl/urihelper.hxx b/include/svl/urihelper.hxx
index b784188461f8..5f7633033ffd 100644
--- a/include/svl/urihelper.hxx
+++ b/include/svl/urihelper.hxx
@@ -152,6 +152,23 @@ SVL_DLLPUBLIC OUString removePassword(OUString const & rURI,
INetURLObject::EncodeMechanism eEncodeMechanism = INetURLObject::WAS_ENCODED,
INetURLObject::DecodeMechanism eDecodeMechanism = INetURLObject::DECODE_TO_IURI,
rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
+
+/** Resolve a URL's host component domain name in IDNA syntax to plain DNS
+ syntax.
+
+ For details, see RFC 5890 "Internationalized Domain Names for Applications
+ (IDNA): Definitions and Document Framework."
+
+ @param: url An arbitrary string, should be a URI.
+
+ @return If the input matches the syntax of a hierarchical URL, and it has
+ a host component that matches the IDNA2008 domain name syntax, and that
+ domain name contains any U-labels, return a version of the input URL with
+ the host component resolved to plain DNS syntax. Otherwise, return the
+ input unchanged.
+*/
+SVL_DLLPUBLIC OUString resolveIdnaHost(OUString const & url);
+
}
#endif // INCLUDED_SVL_URIHELPER_HXX