Index: uspace/app/bdsh/input.c
===================================================================
--- uspace/app/bdsh/input.c	(revision 3636964a0c670d2ee2523425ef20a055d82a337d)
+++ uspace/app/bdsh/input.c	(revision 6071a8f795d4bd0c92c2ca86cdda3afe37e0de79)
@@ -37,4 +37,6 @@
 #include <kbd/kbd.h>
 #include <kbd/keycode.h>
+#include <errno.h>
+#include <bool.h>
 
 #include "config.h"
@@ -100,8 +102,9 @@
 {
 	kbd_event_t ev;
-	int chars;
+	size_t offs, otmp;
+	wchar_t dec;
 
-	chars = 0;
-	while (chars < n - 1) {
+	offs = 0;
+	while (true) {
 		fflush(stdout);
 		if (kbd_get_event(&ev) < 0)
@@ -113,7 +116,16 @@
 			break;
 		if (ev.key == KC_BACKSPACE) {
-			if (chars > 0) {
+			if (offs > 0) {
+				/*
+				 * Back up until we reach valid start of
+				 * character.
+				 */
+				while (offs > 0) {
+					--offs; otmp = offs;
+					dec = str_decode(buffer, &otmp, n);
+					if (dec != U_SPECIAL)
+						break;
+				}
 				putchar('\b');
-				--chars;
 			}
 			continue;
@@ -121,10 +133,10 @@
 		if (ev.c >= ' ') {
 			//putchar(ev.c);
-			console_putchar(ev.c);
-			buffer[chars++] = ev.c;
+			if (chr_encode(ev.c, buffer, &offs, n - 1) == EOK)
+				console_putchar(ev.c);
 		}
 	}
 	putchar('\n');
-	buffer[chars] = '\0';
+	buffer[offs] = '\0';
 }
 
