summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2021-03-04 13:52:55 +0100
committerBastien Nocera <hadess@hadess.net>2021-03-04 13:55:56 +0100
commit6367e5dbe500bb13de5e4d1cfd89a0807a30aaab (patch)
tree4ebedc69203fa527f491843b759492b9f9b392f6
parent789ff3a01811630ab2a3cc5232f5b72453f5f7e7 (diff)
downloadtotem-pl-parser-6367e5dbe500bb13de5e4d1cfd89a0807a30aaab.tar.gz
plparser: Print the UTF-8 conversion error
-rw-r--r--plparse/totem-pl-parser.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/plparse/totem-pl-parser.c b/plparse/totem-pl-parser.c
index bffc89a..dd65b71 100644
--- a/plparse/totem-pl-parser.c
+++ b/plparse/totem-pl-parser.c
@@ -1851,6 +1851,7 @@ totem_pl_parser_parse_xml_relaxed (char *contents,
gsize size)
{
xml_node_t* doc, *node;
+ g_autoptr(GError) error = NULL;
char *encoding, *new_contents;
gsize new_size;
xml_parser_t *xml_parser;
@@ -1879,9 +1880,9 @@ totem_pl_parser_parse_xml_relaxed (char *contents,
xml_parser_free_tree (doc);
- new_contents = g_convert (contents, size, "UTF-8", encoding, NULL, &new_size, NULL);
+ new_contents = g_convert (contents, size, "UTF-8", encoding, NULL, &new_size, &error);
if (new_contents == NULL) {
- g_warning ("Failed to convert XML data to UTF-8");
+ g_warning ("Failed to convert XML data to UTF-8: %s", error->message);
g_free (encoding);
return NULL;
}