inherit maxchar of field value where needed (closes #14648)
diff --git a/Python/formatter_unicode.c b/Python/formatter_unicode.c
index 58e66e0..5e5b19f 100644
--- a/Python/formatter_unicode.c
+++ b/Python/formatter_unicode.c
@@ -747,6 +747,9 @@
         len = format->precision;
     }
 
+    if (len)
+        maxchar = PyUnicode_MAX_CHAR_VALUE(value);
+
     calc_padding(len, format->width, format->align, &lpad, &rpad, &total);
 
     if (lpad != 0 || rpad != 0)