diff --git a/src/main/java/org/codehaus/groovy/control/SourceExtensionHandler.java b/src/main/java/org/codehaus/groovy/control/SourceExtensionHandler.java index 6c512657e2c..ef41e5de8a5 100644 --- a/src/main/java/org/codehaus/groovy/control/SourceExtensionHandler.java +++ b/src/main/java/org/codehaus/groovy/control/SourceExtensionHandler.java @@ -26,6 +26,7 @@ import java.io.IOException; import java.io.InputStreamReader; import java.net.URL; +import java.nio.charset.StandardCharsets; import java.util.Enumeration; import java.util.LinkedHashSet; import java.util.Set; @@ -44,7 +45,7 @@ public static Set getRegisteredExtensions(ClassLoader loader) { globalServices = loader.getResources("META-INF/services/org.codehaus.groovy.source.Extensions"); } for (URL service : DefaultGroovyMethods.toSet(globalServices)) { - try (BufferedReader svcIn = new BufferedReader(new InputStreamReader(URLStreams.openUncachedStream(service)))) { + try (BufferedReader svcIn = new BufferedReader(new InputStreamReader(URLStreams.openUncachedStream(service), StandardCharsets.UTF_8))) { String extension = svcIn.readLine(); while (extension != null) { extension = extension.trim();