From 09513144e81398802b0a9a1281da310d01f0f465 Mon Sep 17 00:00:00 2001 From: Elaine Date: Wed, 15 May 2019 15:04:51 +0800 Subject: [PATCH] issue #24 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 解决SVG文件名含有数字时,会被替换为下划线的问题,保持原来的数字 --- src/com/moxun/s2v/utils/CommonUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/moxun/s2v/utils/CommonUtil.java b/src/com/moxun/s2v/utils/CommonUtil.java index e56750e..9f6dc1e 100644 --- a/src/com/moxun/s2v/utils/CommonUtil.java +++ b/src/com/moxun/s2v/utils/CommonUtil.java @@ -65,7 +65,7 @@ public static String loadMetaInf(String key, String defValue) { public static String getValidName(String s) { char[] chars = s.toLowerCase().replaceAll("\\s*", "").toCharArray(); for (int i = 0; i < chars.length; i++) { - if (!Character.isLetter(chars[i])) { + if (!Character.isLetter(chars[i]) && !Character.isDigit(chars[i])) { chars[i] = '_'; } }