diff options
author | Xavier Roche <xroche@users.noreply.github.com> | 2013-05-19 10:07:45 +0000 |
---|---|---|
committer | Xavier Roche <xroche@users.noreply.github.com> | 2013-05-19 10:07:45 +0000 |
commit | 003cb47b95eb7676ca27791c97de7d884e83d058 (patch) | |
tree | 9ebb74dbf56c2efa3d1400a10f1922edcc64ab9f /src/htsparse.c | |
parent | bb90afc68247b6158abd62430ae7ad4102683c47 (diff) |
Added support for IDNA / RFC 3492 (Punycode) handling within URLs.
Diffstat (limited to 'src/htsparse.c')
-rw-r--r-- | src/htsparse.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/htsparse.c b/src/htsparse.c index fc3b6e1..73f66ac 100644 --- a/src/htsparse.c +++ b/src/htsparse.c @@ -2103,14 +2103,15 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) { // ???? No! escape_spc_url(lien); strcatbuff(lien, query); /* restore */ - // Charset conversion for the URI filename - // (not for the query string!) - if (hasCharset) { + // Charset conversion for the URI filename, + // and not already UTF-8 + // (note: not for the query string!) + if (hasCharset && !hts_isCharsetUTF8(charset)) { char *const s = hts_convertStringToUTF8(lien, (int) strlen(lien), charset); if (s != NULL) { hts_log_print(opt, LOG_DEBUG, - "engine: save-name: charset conversion from '%s' to '%s' using charset '%s'", - lien, s, charset); + "engine: save-name: '%s' charset conversion from '%s' to '%s'", + charset, lien, s); strcpybuff(lien, s); free(s); } |