diff options
Diffstat (limited to 'src/fs/gnunet-fs-gtk-common.c')
-rw-r--r-- | src/fs/gnunet-fs-gtk-common.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/fs/gnunet-fs-gtk-common.c b/src/fs/gnunet-fs-gtk-common.c index e9c052e6..b2bf9b26 100644 --- a/src/fs/gnunet-fs-gtk-common.c +++ b/src/fs/gnunet-fs-gtk-common.c | |||
@@ -59,11 +59,25 @@ GNUNET_FS_GTK_add_meta_data_to_list_store (void *cls, const char *plugin_name, | |||
59 | if (g_utf8_validate (data, data_len, NULL)) | 59 | if (g_utf8_validate (data, data_len, NULL)) |
60 | data_to_insert = data; | 60 | data_to_insert = data; |
61 | else | 61 | else |
62 | { | ||
63 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | ||
64 | "Failed to validate supposedly utf-8 string `%s' of length %u, assuming it to be a C string\n", | ||
65 | data, data_len); | ||
62 | format = EXTRACTOR_METAFORMAT_C_STRING; | 66 | format = EXTRACTOR_METAFORMAT_C_STRING; |
67 | } | ||
63 | } | 68 | } |
64 | if (format == EXTRACTOR_METAFORMAT_C_STRING) | 69 | if (format == EXTRACTOR_METAFORMAT_C_STRING) |
65 | { | 70 | { |
66 | free_data = g_locale_to_utf8 (data, data_len, &rd, &wr, NULL); | 71 | GError *gerr = NULL; |
72 | rd = wr = 0; | ||
73 | free_data = g_locale_to_utf8 (data, data_len, &rd, &wr, &gerr); | ||
74 | if (gerr != NULL) | ||
75 | { | ||
76 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | ||
77 | "Error when converting a C string `%s' of length %u to utf-8 (converted %u to %u bytes): %s\n", | ||
78 | data, data_len, rd, wr, gerr->message); | ||
79 | g_error_free (gerr); | ||
80 | } | ||
67 | data_to_insert = free_data; | 81 | data_to_insert = free_data; |
68 | } | 82 | } |
69 | 83 | ||