diff --git a/ekg/legacyconfig.c b/ekg/legacyconfig.c
index dae62da..96a2d8b 100644
--- a/ekg/legacyconfig.c
+++ b/ekg/legacyconfig.c
@@ -30,13 +30,6 @@
 void config_upgrade() {
 	const int current_config_version = 9;
 
-#if ! USE_UNICODE
-	if (!xstrcasecmp(config_console_charset, "UTF-8")) {
-		print("config_error", _("Warning, nl_langinfo(CODESET) reports that you are using utf-8 encoding, but you didn't compile ekg2 with (experimental/untested) --enable-unicode\n"
-			    "\tPlease compile ekg2 with --enable-unicode or change your enviroment setting to use not utf-8 but iso-8859-1 maybe? (LC_ALL/LC_CTYPE)\n"));
-	}
-#endif
-
 	if (xstrcasecmp(console_charset, config_console_charset)) 
 		print("console_charset_bad", console_charset, config_console_charset);
 	else if (config_version == 0 || config_version == -1)
diff --git a/ekg/recode.c b/ekg/recode.c
index 7ef62ef..af74795 100644
--- a/ekg/recode.c
+++ b/ekg/recode.c
@@ -435,24 +435,6 @@ string_t ekg_convert_string_t_p(string_t s, void *ptr) {
 #endif
 }
 
-string_t ekg_convert_string_t(string_t s, const char *from, const char *to) {
-	string_t r;
-	void *p;
-
-	if (!s || !s->len) /* don't even init iconv if we've got NULL string */
-		return NULL;
-
-	p = ekg_convert_string_init(from, to, NULL);
-	r = ekg_convert_string_t_p(s, p);
-	ekg_convert_string_destroy(p);
-	return r;
-}
-
-void changed_console_charset(const char *name) {
-	if (!in_autoexec && xstrcasecmp(console_charset, config_console_charset)) 
-		print("console_charset_bad", console_charset, config_console_charset);
-}
-
 int ekg_converters_display(int quiet) {
 #ifdef HAVE_ICONV
 	struct ekg_converter *c;
@@ -471,7 +453,7 @@ int ekg_converters_display(int quiet) {
 #endif
 }
 
-static int ekg_utf8_helper(unsigned char *s, int n, unsigned short *ch) {
+static int ekg_utf8_helper(const unsigned char *s, int n, unsigned short *ch) {
 	unsigned char c = s[0];
 
 	if (c < 0x80) {
@@ -505,8 +487,8 @@ invalid:
 	return 1;
 }
 
-static char *ekg_from_utf8(char *b, const unsigned short *recode_table) {	/* sizeof(recode_table) = 0x100 ==> 0x80 items */
-	unsigned char *buf = (unsigned char *) b;
+static char *ekg_from_utf8(const char *b, const unsigned short *recode_table) {	/* sizeof(recode_table) = 0x100 ==> 0x80 items */
+	const unsigned char *buf = (const unsigned char *) b;
 
 	char *newbuf;
 	int newlen = 0;
@@ -550,8 +532,8 @@ static char *ekg_from_utf8(char *b, const unsigned short *recode_table) {	/* siz
 	return newbuf;
 }
 
-static char *ekg_to_utf8(char *b, const unsigned short *recode_table) {		/* sizeof(recode_table) = 0x100 ==> 0x80 items */
-	unsigned char *buf = (unsigned char *) b;
+static char *ekg_to_utf8(const char *b, const unsigned short *recode_table) {		/* sizeof(recode_table) = 0x100 ==> 0x80 items */
+	const unsigned char *buf = (const unsigned char *) b;
 	char *newbuf;
 	int newlen = 0;
 	int i, j;
@@ -659,7 +642,6 @@ string_t ekg_utf8_to_ucs2_dup(const char *b) {
 		r[1] = (unsigned char) wc;
 		string_append_raw(str, (const char *) r, sizeof(r));
 	}
-	/* XXX, NUL? */
 	return str;
 }
 
diff --git a/ekg/recode.h b/ekg/recode.h
index 6ab535e..2ff1d36 100644
--- a/ekg/recode.h
+++ b/ekg/recode.h
@@ -12,9 +12,7 @@ void ekg_convert_string_destroy(void *ptr);
 char *ekg_convert_string_p(const char *ps, void *ptr);
 char *ekg_convert_string(const char *ps, const char *from, const char *to);
 string_t ekg_convert_string_t_p(string_t s, void *ptr);
-string_t ekg_convert_string_t(string_t s, const char *from, const char *to);
 
-void changed_console_charset(const char *name);
 int ekg_converters_display(int quiet);
 
 #define recode_xfree(org, ret) do { if (org != ret) xfree((char *) ret); } while(0); 
diff --git a/ekg/stuff.h b/ekg/stuff.h
index c54346d..2290dd7 100644
--- a/ekg/stuff.h
+++ b/ekg/stuff.h
@@ -364,7 +364,6 @@ void ekg_convert_string_destroy(void *ptr);
 char *ekg_convert_string_p(const char *ps, void *ptr);
 char *ekg_convert_string(const char *ps, const char *from, const char *to);
 string_t ekg_convert_string_t_p(string_t s, void *ptr);
-string_t ekg_convert_string_t(string_t s, const char *from, const char *to);
 int ekg_converters_display(int quiet);
 
 char *password_input(const char *prompt, const char *rprompt, const bool norepeat);
diff --git a/ekg/vars.c b/ekg/vars.c
index a8d240d..5321434 100644
--- a/ekg/vars.c
+++ b/ekg/vars.c
@@ -65,6 +65,11 @@ static int dd_sound(const char *name) { return (config_sound_app != NULL); }
 static int dd_color(const char *name) { return (config_display_color); }
 static int dd_beep(const char *name) { return (config_beep); }
 
+static void changed_console_charset(const char *name) {
+	if (!in_autoexec && xstrcasecmp(console_charset, config_console_charset)) 
+		print("console_charset_bad", console_charset, config_console_charset);
+}
+
 /*
  * variable_init()
  *
diff --git a/plugins/ncurses/old.c b/plugins/ncurses/old.c
index b3bd244..d0410f6 100644
--- a/plugins/ncurses/old.c
+++ b/plugins/ncurses/old.c
@@ -311,6 +311,72 @@ static int ncurses_backlog_add_real(window_t *w, fstring_t *str)
 	return ncurses_backlog_split(w, 0, removed);
 }
 
+#ifdef USE_UNICODE
+
+/* based on static int utf8_mbtowc(conv_t conv, ucs4_t *pwc, const unsigned char *s, int n); from libiconv-1.13.1/lib/utf8.h
+ * Copyright (C) 1999-2001, 2004 Free Software Foundation, Inc. under LGPL-2 */
+static int utf8_mbtowc(wchar_t *pwc, const char *_s, int n) {
+typedef unsigned int ucs4_t;
+
+	unsigned char *s = (unsigned char *) _s;
+	unsigned char c = s[0];
+
+	if (c < 0x80) {
+		*pwc = c;
+		return 1;
+	} 
+	
+	if (c < 0xc2)
+		return -1;
+	
+	if (c < 0xe0) {
+		if (n < 2)
+			return -1;
+		if (!((s[1] ^ 0x80) < 0x40))
+			return -1;
+		*pwc = (wchar_t) ((ucs4_t) (c & 0x1f) << 6) | (ucs4_t) (s[1] ^ 0x80);
+		return 2;
+	} 
+	
+	if (c < 0xf0) {
+		if (n < 3)
+			return -1;
+		if (!((s[1] ^ 0x80) < 0x40 && (s[2] ^ 0x80) < 0x40 && (c >= 0xe1 || s[1] >= 0xa0)))
+			return -1;
+		*pwc = (wchar_t) ((ucs4_t) (c & 0x0f) << 12) | ((ucs4_t) (s[1] ^ 0x80) << 6) | (ucs4_t) (s[2] ^ 0x80);
+		return 3;
+	} 
+	
+	if (c < 0xf8 && sizeof(wchar_t) >= 4) {
+		if (n < 4)
+			return -1;
+		if (!((s[1] ^ 0x80) < 0x40 && (s[2] ^ 0x80) < 0x40 && (s[3] ^ 0x80) < 0x40 && (c >= 0xf1 || s[1] >= 0x90)))
+			return -1;
+		*pwc = (wchar_t) ((ucs4_t) (c & 0x07) << 18) | ((ucs4_t) (s[1] ^ 0x80) << 12) | ((ucs4_t) (s[2] ^ 0x80) << 6) | (ucs4_t) (s[3] ^ 0x80);
+		return 4;
+	} 
+	
+	if (c < 0xfc && sizeof(wchar_t) >= 4) {
+		if (n < 5)
+			return -1;
+		if (!((s[1] ^ 0x80) < 0x40 && (s[2] ^ 0x80) < 0x40 && (s[3] ^ 0x80) < 0x40 && (s[4] ^ 0x80) < 0x40 && (c >= 0xf9 || s[1] >= 0x88)))
+			return -1;
+		*pwc = (wchar_t) ((ucs4_t) (c & 0x03) << 24) | ((ucs4_t) (s[1] ^ 0x80) << 18) | ((ucs4_t) (s[2] ^ 0x80) << 12) | ((ucs4_t) (s[3] ^ 0x80) << 6) | (ucs4_t) (s[4] ^ 0x80);
+		return 5;
+	} 
+	
+	if (c < 0xfe && sizeof(wchar_t) >= 4) {
+		if (n < 6)
+			return -1;
+		if (!((s[1] ^ 0x80) < 0x40 && (s[2] ^ 0x80) < 0x40 && (s[3] ^ 0x80) < 0x40 && (s[4] ^ 0x80) < 0x40 && (s[5] ^ 0x80) < 0x40 && (c >= 0xfd || s[1] >= 0x84)))
+			return -1;
+		*pwc = (wchar_t) ((ucs4_t) (c & 0x01) << 30) | ((ucs4_t) (s[1] ^ 0x80) << 24) | ((ucs4_t) (s[2] ^ 0x80) << 18) | ((ucs4_t) (s[3] ^ 0x80) << 12) | ((ucs4_t) (s[4] ^ 0x80) << 6) | (ucs4_t) (s[5] ^ 0x80);
+		return 6;
+	}
+	return -1;
+}
+#endif
+
 /*
  * ncurses_backlog_add()
  *
@@ -331,27 +397,19 @@ int ncurses_backlog_add(window_t *w, fstring_t *str) {
 		int cur = 0;
 		int i;
 
-		mbtowc(NULL, NULL, 0);	/* reset */
-
 		for (i = 0; cur < rlen; i++) {
 			wchar_t znak;
-			int len	= mbtowc(&znak, &(str->str.b[cur]), rlen-cur);
-
-			if (!len)	/* shouldn't happen -- cur < rlen */
-				break;
+			int len = utf8_mbtowc(&znak, &(str->str.b[cur]), rlen-cur);
 
 			if (len > 0) {
-				temp[i]		= znak;
-				str->attr[i]	= str->attr[cur]; 
+				temp[i]	= znak;
+				str->attr[i] = str->attr[cur]; 
 
 			} else {
-				/* here mbtowc() returns -1 */
-
-/*				debug("[%s:%d] mbtowc() failed ?! (%d, %s) (%d)\n", __FILE__, __LINE__, errno, strerror(errno), i); */
+				temp[i]	= '?';
+				str->attr[i] = str->attr[cur] | FSTR_REVERSE; 
 
-				len		= 1;		/* always move forward */
-				temp[i]		= '?';
-				str->attr[i]	= str->attr[cur] | FSTR_REVERSE; 
+				len	= 1;
 			}
 
 			if (cur == str->prompt_len)
