Use explicit UTF-8 charset in StdioServerTransportProvider (#826)

Also add a test simulating a different locale in an isolated process.

Resolves #295
This commit is contained in:
조형준 2026-03-03 00:57:08 +09:00 • committed by Dariusz Jędrzejczyk
commit 5b9c2fb414
No known key found for this signature in database
GPG key ID: FD786A4E2335C448

View file

@ -200,7 +200,7 @@ public class StdioServerTransportProvider implements McpServerTransportProvider
inboundReady.tryEmitValue(null);
BufferedReader reader = null;
try {
reader = new BufferedReader(new InputStreamReader(inputStream));
reader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8));
while (!isClosing.get()) {
try {
String line = reader.readLine();