--- util-linux-2.13.1.1.orig/fdisk/cfdisk.c	2008-04-21 16:58:43.000000000 +0400
+++ util-linux-2.13.1.1/fdisk/cfdisk.c	2008-05-11 14:06:12.000000000 +0400
@@ -64,6 +64,7 @@
 #include <errno.h>
 #include <getopt.h>
 #include <fcntl.h>
+#include <wchar.h>
 #ifdef HAVE_SLCURSES_H
 #include <slcurses.h>
 #elif defined(HAVE_SLANG_SLCURSES_H)
@@ -346,6 +347,20 @@
      return t;
 }
 
+/* Return correct length (on terminal) for wide string */
+static size_t
+strwidth (const char *s) {
+     wchar_t *wbuf;
+     size_t len;
+     size_t width;
+     len = mbstowcs(NULL, s, 0);
+     wbuf = xmalloc((sizeof (wchar_t)) * (len + 2));
+     mbstowcs(wbuf, s, len + 1);
+     width = wcswidth(wbuf, len);
+     free(wbuf);
+     return width;
+}
+
 /* Some libc's have their own basename() */
 static char *
 my_basename(char *devname) {
@@ -492,7 +507,7 @@
     if (!curses_started) {
 	 fprintf(stderr, "%s\n", s);
     } else {
-	mvaddstr(WARNING_START, (COLS-strlen(s))/2, s);
+	mvaddstr(WARNING_START, (COLS-strwidth(s))/2, s);
 	putchar(BELL); /* CTRL-G */
 
 	warning_last_time = TRUE;
@@ -508,13 +523,13 @@
 	 char *str = xmalloc(strlen(s) + strlen(err1) + strlen(err2) + 10);
 
 	 sprintf(str, "%s: %s", err1, s);
-	 if (strlen(str) > COLS)
+	 if (strwidth(str) > COLS)
 	     str[COLS] = 0;
-	 mvaddstr(WARNING_START, (COLS-strlen(str))/2, str);
+	 mvaddstr(WARNING_START, (COLS-strwidth(str))/2, str);
 	 sprintf(str, "%s", err2);
-	 if (strlen(str) > COLS)
+	 if (strwidth(str) > COLS)
 	     str[COLS] = 0;
-	 mvaddstr(WARNING_START+1, (COLS-strlen(str))/2, str);
+	 mvaddstr(WARNING_START+1, (COLS-strwidth(str))/2, str);
 	 putchar(BELL); /* CTRL-G */
 	 refresh();
 	 (void)getch();
@@ -1127,8 +1142,9 @@
     move( y, x ); clrtoeol();
 
     for( i = 0; menuItems[i].key; i++ ) {
-        char buff[20];
+        char buff[50];
         int lenName;
+	int widthName;
 	const char *mi;
 
         /* Search next available button */
@@ -1151,20 +1167,21 @@
 	else
 		mi = "";
         lenName = strlen( mi );
+        widthName = strwidth( mi );
 #if 0
         if(lenName > itemLength || lenName >= sizeof(buff))
             print_warning(_("Menu item too long. Menu may look odd."));
 #endif
 	if (lenName >= sizeof(buff)) {	/* truncate ridiculously long string */
 	    xstrncpy(buff, mi, sizeof(buff));
-	} else if (lenName >= itemLength) {
+	} else if (widthName >= itemLength) {
             snprintf(buff, sizeof(buff),
 		     (menuType & MENU_BUTTON) ? "[%s]" : "%s", mi);
 	} else {
             snprintf(buff, sizeof(buff),
 		     (menuType & MENU_BUTTON) ? "[%*s%-*s]" : "%*s%-*s",
-		     (itemLength - lenName) / 2, "",
-		     (itemLength - lenName + 1) / 2 + lenName, mi);
+		     (itemLength - widthName) / 2, "",
+		     (itemLength - widthName + 1) / 2 + lenName, mi);
 	}
         mvaddstr( y, x, buff );
 
@@ -1196,7 +1213,7 @@
 
     /* Print the description of selected item */
     mcd = _(menuItems[current].desc);
-    mvaddstr( WARNING_START + 1, (COLUMNS - strlen( mcd )) / 2, mcd );
+    mvaddstr( WARNING_START + 1, (COLUMNS - strwidth( mcd )) / 2, mcd );
     return y;
 }
 
@@ -2033,7 +2050,7 @@
     else if (p->id == FREE_SPACE && p->num == LOGICAL)
 	fp_printf(fp, _("   Logical"));
     else
-	fp_printf(fp, "%2d %-7.7s", p->num+1,
+	fp_printf(fp, "%2d %-7s", p->num+1,
 		  IS_LOGICAL(p->num) ? _("Logical") : _("Primary"));
 
     fp_printf(fp, " ");
@@ -2642,9 +2659,9 @@
 
 
     snprintf(line, COLS+1, "cfdisk (%s)", PACKAGE_STRING);
-    mvaddstr(HEADER_START, (COLS-strlen(line))/2, line);
+    mvaddstr(HEADER_START, (COLS-strwidth(line))/2, line);
     snprintf(line, COLS+1, _("Disk Drive: %s"), disk_device);
-    mvaddstr(HEADER_START+2, (COLS-strlen(line))/2, line);
+    mvaddstr(HEADER_START+2, (COLS-strwidth(line))/2, line);
     {
 	    long long bytes = actual_size*(long long) SECTOR_SIZE;
 	    long long megabytes = bytes/(K*K);
@@ -2656,10 +2673,10 @@
 		    sprintf(line, _("Size: %lld bytes, %lld.%lld GB"),
 			    bytes, megabytes/K, (10*megabytes/K)%10);
     }
-    mvaddstr(HEADER_START+3, (COLS-strlen(line))/2, line);
+    mvaddstr(HEADER_START+3, (COLS-strwidth(line))/2, line);
     snprintf(line, COLS+1, _("Heads: %d   Sectors per Track: %d   Cylinders: %lld"),
 	    heads, sectors, cylinders);
-    mvaddstr(HEADER_START+4, (COLS-strlen(line))/2, line);
+    mvaddstr(HEADER_START+4, (COLS-strwidth(line))/2, line);
 
     mvaddstr(DISK_TABLE_START, NAME_START, _("Name"));
     mvaddstr(DISK_TABLE_START, FLAGS_START, _("Flags"));
@@ -2988,6 +3005,7 @@
 	    exit(1);
 	}
 
+    SLutf8_enable(-1);
     if (argc-optind == 1)
 	disk_device = argv[optind];
     else if (argc-optind != 0) {
