This commit is contained in:
Looly 2022-04-06 11:11:31 +08:00
parent b9f7e062bc
commit 75ec4a5cf6
2 changed files with 15 additions and 2 deletions

View File

@ -7,6 +7,7 @@ import cn.hutool.core.lang.Assert;
import cn.hutool.core.lang.TypeReference;
import cn.hutool.core.text.UnicodeUtil;
import cn.hutool.core.util.ByteUtil;
import cn.hutool.core.util.CharUtil;
import cn.hutool.core.util.CharsetUtil;
import cn.hutool.core.util.ClassUtil;
import cn.hutool.core.util.HexUtil;
@ -777,7 +778,7 @@ public class Convert {
continue;
}
if (c[i] == ' ') {
if (c[i] == CharUtil.SPACE) {
c[i] = '\u3000';
} else if (c[i] < '\177') {
c[i] = (char) (c[i] + 65248);

View File

@ -145,7 +145,7 @@ public class ConsoleTable {
private void fillBorder(StringBuilder sb) {
sb.append(CORNER);
for (Integer width : columnCharNumber) {
sb.append(Convert.toSBC(StrUtil.fillAfter("", ROW_LINE, width + 2)));
sb.append(StrUtil.repeat(ROW_LINE, width + 2));
sb.append(CORNER);
}
sb.append(LF);
@ -158,4 +158,16 @@ public class ConsoleTable {
Console.print(toString());
}
private String fixLength(String input){
int fixLength = 0;
final int length = input.length();
char c;
for (int i = 0; i < length; i++) {
c = input.charAt(i);
if (c < '\177') {
fixLength ++;
}
}
return input + StrUtil.repeat('#', fixLength);
}
}