Index: lib/libedit/chartype.c
===================================================================
--- lib/libedit/chartype.c	(revision 340214)
+++ lib/libedit/chartype.c	(working copy)
@@ -182,17 +182,11 @@
 protected size_t
 ct_enc_width(Char c)
 {
-	/* UTF-8 encoding specific values */
-	if (c < 0x80)
-		return 1;
-	else if (c < 0x0800)
-		return 2;
-	else if (c < 0x10000)
-		return 3;
-	else if (c < 0x110000)
-		return 4;
-	else
-		return 0; /* not a valid codepoint */
+	char buf[MB_LEN_MAX];
+	int size;
+	if ((size = wctomb(buf, c)) < 0)
+		return 0;
+	return size;
 }
 
 protected ssize_t
Index: lib/libedit/read.c
===================================================================
--- lib/libedit/read.c	(revision 340214)
+++ lib/libedit/read.c	(working copy)
@@ -363,17 +363,6 @@
 				goto again;
 			}
 		case (size_t)-2:
-			/*
-			 * We don't support other multibyte charsets.
-			 * The second condition shouldn't happen
-			 * and is here merely for additional safety.
-			 */
-			if ((el->el_flags & CHARSET_IS_UTF8) == 0 ||
-			    cbp >= MB_LEN_MAX) {
-				errno = EILSEQ;
-				*cp = L'\0';
-				return -1;
-			}
 			/* Incomplete sequence, read another byte. */
 			goto again;
 		default:
