Merge lp:~dobey/libubuntuone/default-encoding-0-4 into lp:libubuntuone/stable-0-4

Proposed by dobey
Status: Merged
Approved by: dobey
Approved revision: 120
Merged at revision: 120
Proposed branch: lp:~dobey/libubuntuone/default-encoding-0-4
Merge into: lp:libubuntuone/stable-0-4
Diff against target: 39 lines (+6/-1)
1 file modified
libubuntuone/u1-music-store.c (+6/-1)
To merge this branch: bzr merge lp:~dobey/libubuntuone/default-encoding-0-4
Reviewer Review Type Date Requested Status
Eric Casteleijn (community) Approve
Chad Miller (community) Approve
Review via email: mp+57929@code.launchpad.net

Commit message

Set the default encoding in the web view to UTF-8
Use the UTF-8 encoding when parsing the HTML for status checking

Description of the change

To test:

Have a song purchased from U1MS have accented/extended characters in UTF-8.

./autogen.sh
make U1_JAVASCRIPT_DIR=`pwd`/data
./tests/test-music-store

Go to the "My Downloads" page. Without this fix, the extended character songs should say "transferring" forever. With this fix, they should behave normally like the rest.

To post a comment you must log in.
Revision history for this message
Chad Miller (cmiller) :
review: Approve
Revision history for this message
Eric Casteleijn (thisfred) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libubuntuone/u1-music-store.c'
2--- libubuntuone/u1-music-store.c 2011-03-02 20:43:15 +0000
3+++ libubuntuone/u1-music-store.c 2011-04-15 18:32:46 +0000
4@@ -47,6 +47,7 @@
5 #define U1_CONNECTING_PAGE "connecting.html"
6 #define U1_INITIAL_PAGE "<html><body>Loading Ubuntu One music store</body></html>"
7
8+#define DEFAULT_ENCODING "UTF-8"
9 #define MAXIMUM_AUTH_RETRIES 5
10
11 struct _U1MusicStorePrivate {
12@@ -799,7 +800,7 @@
13 }
14
15 /* Parse HTML */
16- html_doc = htmlParseDoc ((xmlChar *) html->str, NULL);
17+ html_doc = htmlParseDoc ((xmlChar *) html->str, DEFAULT_ENCODING);
18 root_node = xmlDocGetRootElement (html_doc);
19 parse_html_node (music_store, web_view, root_node, current_downloads);
20
21@@ -997,6 +998,7 @@
22 webkit_web_view_get_settings (WEBKIT_WEB_VIEW (music_store->priv->web_viewer))));
23 g_object_set (G_OBJECT (webkit_web_view_get_settings (WEBKIT_WEB_VIEW (music_store->priv->web_viewer))),
24 "user-agent", new_user_agent,
25+ "default-encoding", DEFAULT_ENCODING,
26 "enable-default-context-menu", g_getenv ("U1SHOWCONTEXTMENU") != NULL,
27 "enable-plugins", FALSE,
28 NULL);
29@@ -1017,7 +1019,10 @@
30 /* Show a temp view when loading the initial store page */
31 music_store->priv->initial_web_viewer = webkit_web_view_new ();
32 g_object_set (G_OBJECT (webkit_web_view_get_settings (WEBKIT_WEB_VIEW (music_store->priv->initial_web_viewer))),
33+ "user-agent", new_user_agent,
34+ "default-encoding", DEFAULT_ENCODING,
35 "enable-default-context-menu", g_getenv ("U1SHOWCONTEXTMENU") != NULL,
36+ "enable-plugins", FALSE,
37 NULL);
38 load_internal_html_page (WEBKIT_WEB_VIEW (music_store->priv->initial_web_viewer),
39 U1_CONNECTING_PAGE, NULL);

Subscribers

People subscribed via source and target branches

to all changes: