diff options
author | Xavier Roche <xroche@users.noreply.github.com> | 2013-05-31 14:42:52 +0000 |
---|---|---|
committer | Xavier Roche <xroche@users.noreply.github.com> | 2013-05-31 14:42:52 +0000 |
commit | 759891f1f10d58d8714894fbcaec6103a26c1753 (patch) | |
tree | ccd95ef741b01180a62de35f3d1335f3f3db4171 /src/htsparse.c | |
parent | 37ad0e913a886cf96fe0488542e00e2fbea278a9 (diff) |
Fixed charset for top index titles.
Diffstat (limited to 'src/htsparse.c')
-rw-r--r-- | src/htsparse.c | 14 |
1 files changed, 13 insertions, 1 deletions
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); - } } } |