read output of txt file has white spaces

后端 未结 3 1186
囚心锁ツ
囚心锁ツ 2021-01-21 11:40

i got the list of applications from cmd command using /output:D:\\list.txt product get name,version. However when i try to retrieve the list using java the output has white spac

3条回答
  •  执念已碎
    2021-01-21 12:17

    This can be due to the encoding problem. Try using UTF-16 character set

    BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(path), "UTF-16"));
    

提交回复
热议问题