From 759891f1f10d58d8714894fbcaec6103a26c1753 Mon Sep 17 00:00:00 2001 From: Xavier Roche Date: Fri, 31 May 2013 14:42:52 +0000 Subject: Fixed charset for top index titles. --- src/hts-indextmpl.h | 8 ++++---- src/htsparse.c | 14 +++++++++++++- templates/index-header.html | 2 +- templates/topindex-header.html | 2 +- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/hts-indextmpl.h b/src/hts-indextmpl.h index a4eb715..f0bd5f3 100644 --- a/src/hts-indextmpl.h +++ b/src/hts-indextmpl.h @@ -45,7 +45,7 @@ regen: ""LF\ ""LF\ ""LF\ - " "LF\ + " "LF\ " "LF\ " "LF\ " Local index - HTTrack Website Copier"LF\ @@ -204,7 +204,7 @@ regen: ""LF\ ""LF\ ""LF\ - " "LF\ + " "LF\ " "LF\ " "LF\ " List of available projects - HTTrack Website Copier"LF\ @@ -356,7 +356,7 @@ regen: ""LF\ ""LF\ ""LF\ - " "LF\ + " "LF\ " "LF\ " "LF\ " Page not retrieved! - HTTrack Website Copier"LF\ @@ -492,7 +492,7 @@ regen: ""LF\ ""LF\ ""LF\ - " "LF\ + " "LF\ " "LF\ " "LF\ " Page not retrieved! - HTTrack Website Copier"LF\ diff --git a/src/htsparse.c b/src/htsparse.c index 4868819..1619041 100644 --- a/src/htsparse.c +++ b/src/htsparse.c @@ -718,9 +718,21 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) { strncpy(s, a, b - a + 1); *(s + (b - a) + 1) = '\0'; } + + // Decode title with encoding + if (str->page_charset_ != NULL + && *str->page_charset_ != '\0') { + char *const sUtf = + hts_convertStringToUTF8(s, (int) strlen(s), + str->page_charset_); + if (sUtf != NULL) { + strcpy(s, sUtf); + free(sUtf); + } + } + // Body fprintf(makeindex_fp, template_body, tempo, s); - } } } diff --git a/templates/index-header.html b/templates/index-header.html index 6af81ce..78b7dab 100644 --- a/templates/index-header.html +++ b/templates/index-header.html @@ -1,7 +1,7 @@ - + Local index - HTTrack Website Copier diff --git a/templates/topindex-header.html b/templates/topindex-header.html index 7389759..4193e2d 100644 --- a/templates/topindex-header.html +++ b/templates/topindex-header.html @@ -1,7 +1,7 @@ - + List of available projects - HTTrack Website Copier -- cgit v1.2.3