evolution-rss r415 - in trunk: . src
- From: lucilanga svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution-rss r415 - in trunk: . src
- Date: Mon, 15 Dec 2008 08:48:42 +0000 (UTC)
Author: lucilanga
Date: Mon Dec 15 08:48:42 2008
New Revision: 415
URL: http://svn.gnome.org/viewvc/evolution-rss?rev=415&view=rev
Log:
2008-12-15 Lucian Langa <lucilanga gnome org>
* src/rss.c: decode_entities: new function
for correctly parse title as rfc2047
* src/parser.c: correctly decode (rfc2047)
from: and subject: field
Modified:
trunk/ChangeLog
trunk/src/network-soup.c
trunk/src/rss.c
Modified: trunk/src/network-soup.c
==============================================================================
--- trunk/src/network-soup.c (original)
+++ trunk/src/network-soup.c Mon Dec 15 08:48:42 2008
@@ -19,7 +19,7 @@
*/
#include <string.h>
-#include <libsoup/soup-gnome.h>
+//#include <libsoup/soup-gnome.h>
#include "network.h"
#include "rss.h"
Modified: trunk/src/rss.c
==============================================================================
--- trunk/src/rss.c (original)
+++ trunk/src/rss.c Mon Dec 15 08:48:42 2008
@@ -2955,7 +2955,8 @@
void org_gnome_cooly_rss_startup(void *ep, EMPopupTargetSelect *t)
{
- gchar *ent = decode_entities("mewëm&e¨w\0");
+ g_print("mewëm>e¨w\n");
+ gchar *ent = decode_entities("mewëm>e¨w\0");
g_print("deco%s\n", ent);
g_print("enco%s\n", camel_header_encode_string(ent));
if (gconf_client_get_bool (rss_gconf, GCONF_KEY_START_CHECK, NULL))
@@ -3365,6 +3366,7 @@
status_msg = g_queue_new();
get_feed_folders();
rss_build_stock_images();
+ rss_soup_init();
#if HAVE_DBUS
d(g_print("init_dbus()\n"));
/*D-BUS init*/
@@ -3443,15 +3445,18 @@
info = camel_message_info_new(NULL);
camel_message_info_set_flags(info, CAMEL_MESSAGE_SEEN, 1);
- gchar *tmp = markup_decode(CF->subj);
- camel_mime_message_set_subject(new, tmp);
+ gchar *tmp = decode_entities(CF->subj);
+ gchar *tmp2 = markup_decode(tmp);
+ gchar *safe_subj = camel_header_encode_string(tmp2);
+ camel_mime_message_set_subject(new, safe_subj);
g_free(tmp);
+ g_free(tmp2);
addr = camel_internet_address_new();
d(g_print("date:%s\n", CF->date));
-// g_print("author;%s\n", decode_html("Dag Wieëa"));
- gchar *safe_author = camel_header_encode_string(author);
- g_print("sauthor;%s\n", safe_author);
+ tmp = decode_entities(author);
+ gchar *safe_author = camel_header_encode_string(tmp);
+ g_free(tmp);
camel_address_decode(CAMEL_ADDRESS(addr), safe_author);
camel_mime_message_set_from(new, addr);
camel_object_unref(safe_author);
@@ -3853,7 +3858,6 @@
{
GString *str = g_string_new(NULL);
GString *res = g_string_new(NULL);
- GString *tmp = g_string_new(NULL);
gchar *string, *result;
const unsigned char *s;
guint len;
@@ -3866,7 +3870,6 @@
state = 0;
pos = 1;
g_string_truncate(str, 0);
- tmp = g_string_new(NULL);
while (*s != 0 || len) {
if (state) {
if (*s==';') {
@@ -3886,16 +3889,16 @@
len--;
}
if (state == 2) {
- g_string_erase(res, in, out-in);
htmlEntityDesc *my = htmlEntityLookup((xmlChar *)str->str);
- g_string_printf(tmp, "\\u%04x", my->value);
- g_string_insert(res, in, tmp->str);
- g_string_free(tmp, FALSE);
- gchar *result = res->str;
- g_string_free(res, FALSE);
- res = g_string_new(NULL);
- g_string_append(res, result);
- goto reent;
+ if (my) {
+ g_string_erase(res, in, out-in);
+ g_string_insert_unichar(res, in, my->value);
+ gchar *result = res->str;
+ g_string_free(res, FALSE);
+ res = g_string_new(NULL);
+ g_string_append(res, result);
+ goto reent;
+ }
}
result = res->str;
g_string_free(res, FALSE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]