Skip to content

Commit 503f565

Browse files
committed
Support normalize scanned resource path
Fixes mybatisgh-718
1 parent f7c152c commit 503f565

File tree

1 file changed

+4
-2
lines changed
  • mybatis-spring-boot-autoconfigure/src/main/java/org/mybatis/spring/boot/autoconfigure

1 file changed

+4
-2
lines changed

mybatis-spring-boot-autoconfigure/src/main/java/org/mybatis/spring/boot/autoconfigure/SpringBootVFS.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import java.net.URL;
2121
import java.net.URLDecoder;
2222
import java.nio.charset.Charset;
23+
import java.text.Normalizer;
2324
import java.util.List;
2425
import java.util.stream.Collectors;
2526
import java.util.stream.Stream;
@@ -79,8 +80,9 @@ public static void setUrlDecodingCharset(Charset charset) {
7980
private static String preserveSubpackageName(final String baseUrlString, final Resource resource,
8081
final String rootPath) {
8182
try {
82-
return rootPath + (rootPath.endsWith("/") ? "" : "/")
83-
+ resource.getURL().toString().substring(baseUrlString.length());
83+
return rootPath + (rootPath.endsWith("/") ? "" : "/") + Normalizer
84+
.normalize(URLDecoder.decode(resource.getURL().toString(), urlDecodingCharset.name()), Normalizer.Form.NFC)
85+
.substring(baseUrlString.length());
8486
} catch (IOException e) {
8587
throw new UncheckedIOException(e);
8688
}

0 commit comments

Comments
 (0)