# HG changeset patch # User zas_ # Date 1210664077 0 # Node ID 42d36db921bcd456a2841f775dea2eef06cae796 # Parent 91dfc98f3ca17fc3fa66481a3f0e71b9532610c5 Ensure that we end with UTF8 encoded comment and keywords. diff -r 91dfc98f3ca1 -r 42d36db921bc src/bar_info.c --- a/src/bar_info.c Mon May 12 23:26:00 2008 +0000 +++ b/src/bar_info.c Tue May 13 07:34:37 2008 +0000 @@ -173,7 +173,12 @@ { while (*ptr != '\n' && *ptr != '\0') ptr++; *ptr = '\0'; - if (strlen(s_buf) > 0) list = g_list_prepend(list, g_strdup(s_buf)); + if (strlen(s_buf) > 0) + { + gchar *kw = utf8_validate_or_convert(g_strdup(s_buf)); + + list = g_list_prepend(list, kw); + } } break; case MK_COMMENT: @@ -198,7 +203,10 @@ len = strlen(ptr); while (len > 0 && ptr[len - 1] == '\n') len--; if (ptr[len] == '\n') len++; /* keep the last one */ - if (len > 0) *comment = g_strndup(ptr, len); + if (len > 0) + { + *comment = utf8_validate_or_convert(g_strndup(ptr, len)); + } } g_string_free(comment_build, TRUE); }