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/htsparse.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/htsparse.c') 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