--- gkrellm-newsticker-0.3.orig/newsticker.c
+++ gkrellm-newsticker-0.3/newsticker.c
@@ -39,6 +39,9 @@
 
 #include <gkrellm/gkrellm.h>
 #include <pthread.h>
+#include <errno.h>
+#include <langinfo.h>
+#include <iconv.h>
 
 #include <curl/curl.h>
 #include <curl/types.h>
@@ -68,6 +71,7 @@
     gchar		*file;
     gchar		*link;
     gchar		*tooltip_text;
+    gchar		*encoding;
     gshort		headline_xoff;
     gshort		x_scroll;
     gshort		failures;
@@ -190,6 +194,62 @@
     return tmp;
 }
 
+
+/* file encoding convertion */
+static gchar *convert_charset(Newsticker *nt, gchar *src)
+{
+  iconv_t	 cd;
+  gint		 inbytesleft;
+  gint		 outbytesleft;
+  gchar		*to;
+  gchar		*dst;
+  gint		 len;
+  gchar		*encoding = (nt->encoding ? nt->encoding : "utf-8");
+  gchar		*locale;
+
+
+  (void)setlocale(LC_CTYPE, NULL);
+  locale = nl_langinfo(CODESET);
+  if ((cd = iconv_open(locale, encoding)) == (iconv_t)-1) {
+	return NULL;
+  }
+  inbytesleft = strlen(src);
+  outbytesleft = len = inbytesleft * 2 + 1;
+  to = dst = g_new(gchar, outbytesleft);
+
+  while (iconv(cd, &src, &inbytesleft, &to, &outbytesleft) == -1) {
+    gboolean end = FALSE;
+    gint read_len;
+    switch(errno) {
+    case E2BIG:
+      len *= 2;
+      read_len = to-dst;
+      dst = g_renew(gchar, dst, len);
+      to = dst + read_len;
+      break;
+    case EILSEQ:
+      src++;
+      inbytesleft--;
+      break;
+    case EINVAL:
+      g_warning("EINVAL: len=%d: |%s|", strlen(src), src);
+      end = TRUE;
+      break;
+    default:
+      g_warning("unknown: len=%d: |%s|", strlen(src), src);
+      end = TRUE;
+      break;
+    }
+    if (end)
+      break;
+  }
+
+  to[0] = '\0';
+  iconv_close(cd);
+
+  return dst;
+}
+
 	    
 /* Needed by libcurl */
 size_t write_data(void *ptr, size_t size, size_t nmemb, FILE *stream)
@@ -285,6 +345,32 @@
     headline_old = g_strdup(nt->headline);
     flag = 0;
     nt->link = "NULL";
+    /* detect encoding */
+    if (nt->encoding != NULL) {
+	g_free(nt->encoding);
+	nt->encoding = NULL;
+    }
+    if (fgets(buf, sizeof(buf), f) != NULL) {
+	if ((pt = strchr(buf, '>')) != NULL) {
+	    pt[0] = '\0';
+	}
+	if ((pt = strstr(buf, "encoding")) != NULL
+	    && (pt = strchr(pt, '=')) != NULL) {
+	    pt++;
+	    if ((pt2 = strchr(pt, '"')) != NULL) {
+		pt = pt2+1;
+		if ((pt2 = strchr(pt, '"')) != NULL
+		    || (pt2 = strchr(pt, '?')) != NULL ) {
+		    pt2[0] = '\0';
+		}
+	    } else {
+		if ((pt2 = strchr(pt, '?')) != NULL) {
+		    pt2[0] = '\0';
+		}
+	    }
+	    nt->encoding = g_strdup(pt);
+	}
+    }
     while ((fgets(buf, sizeof(buf), f)))
     {
 	if (((pt = strstr(buf, "<link>")) != NULL) && (!flag))
@@ -352,10 +438,14 @@
 /* Compute the xoff value for a headline */
 static gint compute_xoff(Newsticker *nt)
 {
-    gshort		xoff;
-    
+    gshort		 xoff;
+    gchar		*headline;
     
-    xoff = -gdk_string_width(gkrellm_default_font(1), nt->headline);
+    if ((headline = convert_charset(nt, nt->headline)) == NULL) {
+      headline = g_strconcat("iconv: fail: ", nt->headline, NULL);
+    }
+    xoff = -gdk_string_width(gkrellm_default_font(1), headline);
+    g_free(headline);
     
     return xoff;
 }
@@ -364,11 +454,17 @@
 /* Updates the tooltips */
 static void update_tooltip(Newsticker *nt)
 {
+    gchar	*headline;
+
+
+    if ((headline = convert_charset(nt, nt->headline)) == NULL) {
+	headline = g_strconcat("iconv: fail: ", nt->headline, NULL);
+    }
     if ((update_freq * nt->failures) > 60)
-	nt->tooltip_text = g_strdup_printf("%s: %s (outdated)", nt->label, nt->headline);
+	nt->tooltip_text = g_strdup_printf("%s: %s (outdated)", nt->label, headline);
     else
-	nt->tooltip_text = g_strdup_printf("%s: %s", nt->label, nt->headline);
-    
+	nt->tooltip_text = g_strdup_printf("%s: %s", nt->label, headline);
+    g_free(headline);
     gtk_tooltips_set_tip(nt->tooltip, GTK_WIDGET(nt->panel->drawing_area), nt->tooltip_text, NULL);
     gtk_tooltips_enable(nt->tooltip);
    
@@ -434,6 +530,7 @@
 
     for (i = 0, list = newsticker_list; list; list = list->next, i++)
     {
+	gchar* headline;
 	nt = (Newsticker *) list->data;
     
 	if (nt->x_scroll > nt->headline_xoff)
@@ -442,7 +539,11 @@
 	    nt->x_scroll = w;
 		    
 	nt->decal->x_off = nt->x_scroll;
-	gkrellm_draw_decal_text(nt->panel, nt->decal, nt->headline, w - nt->x_scroll);
+	if ((headline = convert_charset(nt, nt->headline)) == NULL) {
+	  headline = g_strconcat("iconv: fail: ", nt->headline, NULL);
+	}
+	gkrellm_draw_decal_text(nt->panel, nt->decal, headline, w - nt->x_scroll);
+	g_free(headline);
 	if (!i)
 	{
 	    gkrellm_draw_decal_pixmap(nt->panel, led[0], led_value[0]);
@@ -1036,6 +1137,9 @@
     browser_list = NULL;
     browser_list = g_list_append(browser_list, "mozilla '%s'");
     browser_list = g_list_append(browser_list, "netscape '%s'");
+    browser_list = g_list_append(browser_list, "gnome-moz-remote --newwin '%s'");
+    browser_list = g_list_append(browser_list, "Eterm --select-line --borderless -O --buttonbar off --tint lightblue --login-shell --term-name kterm --exec emacs -nw --eval '(w3m \"%s\")'");
+    browser_list = g_list_append(browser_list, "kterm -e emacs -nw --eval '(w3m \"%s\")'");
     gtk_combo_set_popdown_strings(GTK_COMBO(browser_combo), browser_list);
     gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(browser_combo)->entry), browser);
 
@@ -1262,7 +1366,7 @@
     update_freq = gtk_spin_button_get_value_as_int(spin);
 
     gkrellm_dup_string(&browser, gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(browser_combo)->entry)));
-    g_strdown(browser);
+    /* g_strdown(browser); */
 
     use_proxy = GTK_TOGGLE_BUTTON(proxy_button)->active;
     if ((use_proxy) && (strcmp(proxy, "none")))
