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 +++++++++++++- 2 files changed, 17 insertions(+), 5 deletions(-) (limited to 'src') 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); - } } } -- cgit v1.2.3