patch 8.2.2933: when 'clipboard' is "unnamed" zp does not work correctly

Problem:    When 'clipboard' is "unnamed" zp and zP do not work correctly.
Solution:   Pass -1 to str_to_reg() and fix computing the character width
            instead of using the byte length. (Christian Brabandt,
            closes #8301, closes #8317)
diff --git a/src/clipboard.c b/src/clipboard.c
index c263492..b1da99b 100644
--- a/src/clipboard.c
+++ b/src/clipboard.c
@@ -2090,7 +2090,7 @@
 
     clip_free_selection(cbd);
 
-    str_to_reg(y_ptr, type, str, len, 0L, FALSE);
+    str_to_reg(y_ptr, type, str, len, -1, FALSE);
 }
 
 /*
diff --git a/src/mbyte.c b/src/mbyte.c
index 6df3a15..4b78eee 100644
--- a/src/mbyte.c
+++ b/src/mbyte.c
@@ -4308,7 +4308,6 @@
     return count;
 }
 
-#if (defined(FEAT_SPELL) || defined(FEAT_EVAL)) || defined(PROTO)
 /*
  * Like mb_charlen() but for a string with specified length.
  */
@@ -4323,7 +4322,6 @@
 
     return count;
 }
-#endif
 
 /*
  * Try to un-escape a multi-byte character.
diff --git a/src/register.c b/src/register.c
index f4d9343..8680c6b 100644
--- a/src/register.c
+++ b/src/register.c
@@ -2836,6 +2836,7 @@
     char_u	**ss;
     char_u	**pp;
     long	maxlen;
+    int	charlen;
 
     if (y_ptr->y_array == NULL)		// NULL means empty register
 	y_ptr->y_size = 0;
@@ -2894,22 +2895,26 @@
     {
 	for (ss = (char_u **) str; *ss != NULL; ++ss, ++lnum)
 	{
+	    charlen = MB_CHARLEN(*ss);
 	    i = (long)STRLEN(*ss);
 	    pp[lnum] = vim_strnsave(*ss, i);
-	    if (i > maxlen)
-		maxlen = i;
+	    if (charlen > maxlen)
+		maxlen = charlen;
 	}
     }
     else
     {
 	for (start = 0; start < len + extraline; start += i + 1)
 	{
+	    charlen = 0;
 	    for (i = start; i < len; ++i)	// find the end of the line
 		if (str[i] == '\n')
 		    break;
 	    i -= start;			// i is now length of line
-	    if (i > maxlen)
-		maxlen = i;
+	    if (start < len)
+		charlen = mb_charlen_len(str + start, i);
+	    if (charlen > maxlen)
+		maxlen = charlen;
 	    if (append)
 	    {
 		--lnum;
diff --git a/src/version.c b/src/version.c
index 5ebcfcb..ab4ffeb 100644
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    2933,
+/**/
     2932,
 /**/
     2931,