mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Use console charset for reading/writing to stdin/out
This commit is contained in:
parent
425e451237
commit
e03c48e0ae
4 changed files with 9 additions and 5 deletions
|
@ -48,7 +48,8 @@ public class JsonRpcDispatcherCommand implements LocalCommand {
|
|||
m.setIgnoreAttachments(ignoreAttachments);
|
||||
|
||||
final var jsonOutputWriter = (JsonWriter) outputWriter;
|
||||
final Supplier<String> lineSupplier = IOUtils.getLineSupplier(new InputStreamReader(System.in));
|
||||
final Supplier<String> lineSupplier = IOUtils.getLineSupplier(new InputStreamReader(System.in,
|
||||
IOUtils.getConsoleCharset()));
|
||||
|
||||
final var handler = new SignalJsonRpcDispatcherHandler(jsonOutputWriter, lineSupplier, false);
|
||||
handler.handleConnection(m);
|
||||
|
|
|
@ -24,7 +24,6 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
@ -120,7 +119,7 @@ public class SendCommand implements JsonRpcLocalCommand {
|
|||
if (readMessageFromStdin || (messageText == null && sticker == null)) {
|
||||
logger.debug("Reading message from stdin...");
|
||||
try {
|
||||
messageText = IOUtils.readAll(System.in, Charset.defaultCharset());
|
||||
messageText = IOUtils.readAll(System.in, IOUtils.getConsoleCharset());
|
||||
} catch (IOException e) {
|
||||
throw new UserErrorException("Failed to read message from stdin: " + e.getMessage());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue