Merge branch 'subtree'
[fanfix.git] / src / jexer / TMessageBox.java
index c93ad832d06459b925687969327d77d50371a9db..6f1e8a69486b05141b085bda4b841ba474aef347 100644 (file)
@@ -32,6 +32,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.ResourceBundle;
 
+import jexer.bits.StringUtils;
 import jexer.event.TKeypressEvent;
 import static jexer.TKeypress.*;
 
@@ -187,11 +188,11 @@ public class TMessageBox extends TWindow {
 
         // Determine width and height
         String [] lines = caption.split("\n");
-        int width = title.length() + 12;
+        int width = StringUtils.width(title) + 12;
         setHeight(6 + lines.length);
         for (String line: lines) {
-            if (line.length() + 4 > width) {
-                width = line.length() + 4;
+            if (StringUtils.width(line) + 4 > width) {
+                width = StringUtils.width(line) + 4;
             }
         }
         setWidth(width);