summaryrefslogtreecommitdiff
path: root/src/htscore.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/htscore.c')
-rw-r--r--src/htscore.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/htscore.c b/src/htscore.c
index de202db..6e2b198 100644
--- a/src/htscore.c
+++ b/src/htscore.c
@@ -249,7 +249,10 @@ if (!makeindex_done) { \
if (makeindex_fp) { \
char BIGSTK tempo[1024]; \
if (makeindex_links == 1) { \
- sprintf(tempo,"<meta HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=%s\">"CRLF,makeindex_firstlink); \
+ char BIGSTK link_escaped[HTS_URLMAXSIZE*2]; \
+ strcpybuff(link_escaped, makeindex_firstlink); \
+ escape_check_url(link_escaped); \
+ sprintf(tempo,"<meta HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=%s\">"CRLF, link_escaped); \
} else \
tempo[0]='\0'; \
fprintf(makeindex_fp,template_footer, \
@@ -1461,6 +1464,12 @@ int httpmirror(char* url1, httrackp* opt) {
if (charset != NULL)
free(charset);
}
+ /* Could not detect charset: could it be UTF-8 ? */
+ if (page_charset[0] == '\0') {
+ if (is_unicode_utf8(r.adr, r.size)) {
+ strcpy(page_charset, "utf-8");
+ }
+ }
/* Could not detect charset */
if (page_charset[0] == '\0') {
if ( (opt->debug>0) && (opt->log!=NULL) ) {
@@ -1741,7 +1750,7 @@ int httpmirror(char* url1, httrackp* opt) {
// a partir d'ici le slash devient antislash
#endif
- if ((fp=fopen(tempo,"wb"))!=NULL) {
+ if ((fp=FOPEN(tempo,"wb"))!=NULL) {
fprintf(fp,"Info-file generated by HTTrack Website Copier "HTTRACK_VERSION"%s"CRLF""CRLF, hts_get_version_info(opt));
fprintf(fp,"The file %s has not been scanned by HTS"CRLF,savename);
fprintf(fp,"Some links contained in it may be unreachable locally."CRLF);