@@ -83,6 +83,9 @@ public class TCKUtilities {
8383 static final String MVN_WRAPPER_REPO = "https://repo.maven.apache.org/maven2/" ;
8484 static final String BUILD_CACHE_DIR_PROPERTY = "fat.test.build.cache.dir" ;
8585
86+ // Convert from EBCDIC on z/OS
87+ static final Charset zosSafeCharset = TCKUtilities .isZos () ? Charset .forName ("IBM1047" ) : Charset .defaultCharset ();
88+
8689 static String generateSHA256 (File file ) {
8790 String sha256 = null ;
8891 try (FileInputStream fis = new FileInputStream (file )) {
@@ -306,9 +309,7 @@ public static ProcessResult startProcess(String command, List<String> params, Fi
306309
307310 Process process = pb .start ();
308311
309- // Convert from EBCDIC on z/OS
310- Charset charset = TCKUtilities .isZos () ? Charset .forName ("IBM1047" ) : Charset .defaultCharset ();
311- Reader processReader = new InputStreamReader (process .getInputStream (), charset );
312+ Reader processReader = new InputStreamReader (process .getInputStream (), zosSafeCharset );
312313
313314 StreamMonitor monitor = new StreamMonitor (processReader );
314315 monitor .logToFile (logFile );
@@ -897,7 +898,8 @@ private static Set<String> getDetectedShortNames() {
897898 try (DirectoryStream <Path > stream = Files .newDirectoryStream (Paths .get (libPath ), "*.mf" )) {
898899 for (Path path : stream ) {
899900 if (!Files .isDirectory (path )) {
900- try (Stream <String > lineStream = Files .lines (path )) {
901+
902+ try (Stream <String > lineStream = Files .lines (path , zosSafeCharset )) {
901903 lineStream
902904 .filter (line -> line .startsWith ("IBM-ShortName: " ))
903905 .map (line -> line .replaceAll ("IBM-ShortName: " , "" ))
0 commit comments