After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 752895 - lua-factory: Also try convert HTML from ISO8859-1
lua-factory: Also try convert HTML from ISO8859-1
Status: RESOLVED FIXED
Product: grilo
Classification: Other
Component: lua
unspecified
Other All
: Normal normal
: ---
Assigned To: grilo-maint
grilo-maint
Depends on:
Blocks:
 
 
Reported: 2015-07-26 16:25 UTC by Bastien Nocera
Modified: 2015-07-27 12:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
lua-factory: Also try convert HTML from ISO8859-1 (1.54 KB, patch)
2015-07-26 16:25 UTC, Bastien Nocera
committed Details | Review
lua-factory: Fix memory leak fetching ISO8859-1 text (1.55 KB, patch)
2015-07-27 11:06 UTC, Bastien Nocera
committed Details | Review

Description Bastien Nocera 2015-07-26 16:25:10 UTC
.
Comment 1 Bastien Nocera 2015-07-26 16:25:14 UTC
Created attachment 308178 [details] [review]
lua-factory: Also try convert HTML from ISO8859-1

The OKGoals source will try and download:
http://www.okgoals.com/page-start_from_108.0_archive_.html
which contains an ISO8859-1 accent, despite being declared as UTF-8. Try
to convert from ISO8859-1 before giving up on the download content.
Comment 2 Victor Toso 2015-07-27 09:34:16 UTC
Review of attachment 308178 [details] [review]:

Comments below

::: src/lua-factory/grl-lua-library.c
@@ +456,3 @@
     data = NULL;
   } else if (!g_utf8_validate(data, len, NULL)) {
+    char *fixed;

gchar ?

@@ +463,3 @@
+      data = NULL;
+    } else {
+      data = fixed;

You are leaking the `fixed` string here
(data from grl_net_wc_request_finish doesn't need to be freed but  from g_convert it does)
Comment 3 Bastien Nocera 2015-07-27 10:58:58 UTC
Comment on attachment 308178 [details] [review]
lua-factory: Also try convert HTML from ISO8859-1

Pushed by accident.
Comment 4 Bastien Nocera 2015-07-27 11:06:06 UTC
Created attachment 308208 [details] [review]
lua-factory: Fix memory leak fetching ISO8859-1 text

Fix memory leak introduced in e064a170316e2a737d0625720b706e4c08bae6e6
when the text downloaded is actually in ISO8859-1 format.
Comment 5 Victor Toso 2015-07-27 12:23:49 UTC
Pushing leak fix.

Attachment 308208 [details] pushed as 57b345f - lua-factory: Fix memory leak fetching ISO8859-1 text