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

Proposed by dobey
Status: Merged
Approved by: dobey
Approved revision: 134
Merged at revision: 134
Proposed branch: lp:~dobey/libubuntuone/default-encoding-0-10
Merge into: lp:libubuntuone/stable-0-10
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-10
Reviewer Review Type Date Requested Status
Chad Miller (community) Approve
Roman Yepishev (community) fieldtest Approve
Review via email: mp+57927@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
Roman Yepishev (rye) wrote :

Freeway To Üsküdar - Brooklyn Funk Essentials: Download complete

review: Approve (fieldtest)
Revision history for this message
Chad Miller (cmiller) :
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-04-06 20:41:04 +0000
3+++ libubuntuone/u1-music-store.c 2011-04-15 18:32:41 +0000
4@@ -50,6 +50,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@@ -822,7 +823,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@@ -1271,6 +1272,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@@ -1296,7 +1298,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: