summaryrefslogtreecommitdiff
path: root/src/htsencoding.h
diff options
context:
space:
mode:
authorXavier Roche <xroche@users.noreply.github.com>2013-08-17 09:09:13 +0000
committerXavier Roche <xroche@users.noreply.github.com>2013-08-17 09:09:13 +0000
commit2d6017ad06ed6ea571384f51705ce1e53aefb2da (patch)
tree4ee026c01b5f68204837abc898c0d7d490528b0f /src/htsencoding.h
parente0022540014d498ee2ba366000c91c118db52b36 (diff)
Fixed issue 25 regarding un-encoding of characters such as # in the filename.
Diffstat (limited to 'src/htsencoding.h')
-rw-r--r--src/htsencoding.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/htsencoding.h b/src/htsencoding.h
index 4ab660b..e119c4a 100644
--- a/src/htsencoding.h
+++ b/src/htsencoding.h
@@ -42,6 +42,14 @@ Please visit our Website: http://www.httrack.com
#endif
/**
+ * Flags for hts_unescapeUrlSpecial().
+ **/
+typedef enum unescapeFlags {
+ /** Do not decode ASCII. **/
+ UNESCAPE_URL_NO_ASCII = 1
+} unescapeFlags;
+
+/**
* Unescape HTML entities (as per HTML 4.0 Specification)
* and replace them in-place by their UTF-8 equivalents.
* Note: source and destination may be the same, and the destination only
@@ -71,4 +79,16 @@ extern int hts_unescapeEntitiesWithCharset(const char *src,
**/
extern int hts_unescapeUrl(const char *src, char *dest, const size_t max);
+/**
+ * Unescape an URL-encoded string. The implicit charset is UTF-8.
+ * In case of UTF-8 decoding error inside URL-encoded characters,
+ * the characters are left undecoded.
+ * "flags" is a mask composed of UNESCAPE_URL_XXX constants.
+ * Note: source and destination MUST NOT be the same.
+ * Returns 0 upon success, -1 upon overflow or error.
+ **/
+extern int hts_unescapeUrlSpecial(const char *src,
+ char *dest, const size_t max,
+ int flags);
+
#endif