#1548 TTF export - correctly handle duplicate unicode codes

#1548 correctly handle empty generated file names
This commit is contained in:
Jindra Petřík
2021-01-06 09:38:43 +01:00
parent 5089289e43
commit dabb55d21d
3 changed files with 27 additions and 15 deletions

View File

@@ -843,13 +843,15 @@ public class Helper {
}
}
char lastChar = sb.charAt(sb.length() - 1);
if (lastChar == ' ') {
sb.setLength(sb.length() - 1);
sb.append("%20");
} else if (lastChar == '.') {
sb.setLength(sb.length() - 1);
sb.append("%2E");
if (!sb.isEmpty()) {
char lastChar = sb.charAt(sb.length() - 1);
if (lastChar == ' ') {
sb.setLength(sb.length() - 1);
sb.append("%20");
} else if (lastChar == '.') {
sb.setLength(sb.length() - 1);
sb.append("%2E");
}
}
str = sb.toString();