簡體   English   中英

使用 ExecutorService.submit 結果得到亂碼

[英]use ExecutorService.submit result get Garbled

我使用jPowerShell在Java中執行powershell,但是我在executeCommand()時出現了亂碼

這是我的代碼:

PowerShellResponse response = powerShell.executeCommand(getAll);
//Print results
System.out.println("result :" + response.getCommandOutput());

executeCommand()使用:

Future<String> result = threadpool.submit(commandProcessor);
commandOutput = result.get();

我不知道如何對結果進行編碼。

也許這會有所幫助?

Future<String> result = threadpool.submit(commandProcessor);
while (!result.isDone()) {}
String commandOutput = result.get();

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM