--- charset.c	2006-05-08 13:21:48.816375000 -0600
+++ charset.c.new	2006-05-11 05:49:18.175750000 -0600
@@ -328,6 +328,7 @@
 {
     char_u	*res;
     char_u	*p;
+    int		res_added = 0;
 #ifdef FEAT_MBYTE
     int		l, len, c;
     char_u	hexbuf[11];
@@ -386,7 +387,57 @@
 	    }
 	    else
 #endif
-		STRCAT(res, transchar_byte(*p++));
+	    {
+		if ( *p == K_SPECIAL )
+		{
+		    int	    key = 0;
+		    char_u  *key_name;
+		    int	    modifiers = 0;
+		    char_u  *old_p = p;
+
+		    if ( *(p+1) == KS_MODIFIER )
+		    {
+			modifiers = *(p+2);
+			p += 3;
+		    }
+
+		    if ( *p == K_SPECIAL )
+		    {
+			key = TERMCAP2KEY( *(p+1), *(p+2) );
+			p += 3;
+		    }
+		    else
+			key = *p++;
+
+		    key = simplify_key( key, &modifiers );
+
+		    // crashes in isalpha() for some chars!!
+		    //key = extract_modifiers( key, &modifiers );
+
+		    key_name = get_special_key_name( key, modifiers);
+
+		    if (       STRCMP( key_name, "" ) 
+			    && STRCMP( key_name, "<>" ) 
+			    && STRCMP( key_name, "<\\200>") )
+		    {
+			char_u res1;
+
+			res_added += STRLEN( key_name );
+			// vim_realloc does a free()
+			res = realloc( res, 
+				(unsigned)(vim_strsize(s) + 1) + res_added );
+			STRCAT( res, key_name );
+		    }
+		    else
+		    {
+			p = old_p;
+			STRCAT(res, transchar_byte(*p++));
+		    }
+
+		}
+		else
+		    STRCAT(res, transchar_byte(*p++));
+	    }
 	}
     }
     return res;
