*
* - Read/write a line of RFC4180 comma-separated values strings to/from a
* list of strings.
+ *
+ * - Compute number of visible text cells for a given Unicode codepoint or
+ * string.
+ *
+ * - Convert bytes to and from base-64 encoding.
*/
public class StringUtils {
* @return the number of text cell columns required to display this string
*/
public static int width(final String str) {
+ if (str == null) {
+ return 0;
+ }
+
int n = 0;
for (int i = 0; i < str.length();) {
int ch = str.codePointAt(i);