11package com .checkmarx .ast .wrapper ;
22
33import org .slf4j .Logger ;
4-
54import java .io .*;
65import java .net .URL ;
76import java .nio .charset .StandardCharsets ;
@@ -83,7 +82,7 @@ static String executeCommand(List<String> arguments,
8382 File outputFile = new File (directory , file );
8483
8584 return new String (Files .readAllBytes (Paths .get (outputFile .getAbsolutePath ())),
86- StandardCharsets .UTF_8 );
85+ StandardCharsets .UTF_8 );
8786 }
8887
8988 static String getTempBinary () throws IOException {
@@ -98,7 +97,7 @@ static String getTempBinary() throws IOException {
9897 }
9998 File tempExecutable = new File (TEMP_DIR , fileName );
10099 if (!tempExecutable .exists () || !compareChecksum (resource .openStream (),
101- new FileInputStream (tempExecutable ))) {
100+ new FileInputStream (tempExecutable ))) {
102101 copyURLToFile (resource , tempExecutable );
103102 }
104103 if (!tempExecutable .canExecute () && !tempExecutable .setExecutable (true )) {
@@ -111,7 +110,7 @@ static String getTempBinary() throws IOException {
111110
112111 private static BufferedReader getReader (Process process ) {
113112 InputStream is = process .getInputStream ();
114- InputStreamReader isr = new InputStreamReader (is );
113+ InputStreamReader isr = new InputStreamReader (is , StandardCharsets . UTF_8 );
115114 return new BufferedReader (isr );
116115 }
117116
@@ -167,7 +166,7 @@ private static String md5(InputStream a) {
167166 while ((i = a .read (buf )) != -1 ) {
168167 md .update (buf , 0 , i );
169168 }
170- md5 = new String (md .digest ());
169+ md5 = new String (md .digest (), StandardCharsets . UTF_8 );
171170 } catch (NoSuchAlgorithmException | IOException e ) {
172171 // ignore
173172 }
0 commit comments