Commit a34570a
committed
Specify UTF-8 charset explicitly in STDIO transport InputStreamReader
The MCP specification requires UTF-8 encoding for STDIO transport
messages, but some InputStreamReader instances were created without
an explicit charset, falling back to the JRE default encoding which
may not be UTF-8 on all platforms.
This change adds StandardCharsets.UTF_8 to all InputStreamReader
constructors in StdioClientTransport (stdin and stderr readers)
and StdioServerTransportProvider (stdin reader) for consistency
with the output streams that already specify UTF-8.
Resolves #2951 parent 29dc250 commit a34570a
File tree
2 files changed
+4
-3
lines changed- mcp-core/src/main/java/io/modelcontextprotocol
- client/transport
- server/transport
2 files changed
+4
-3
lines changedLines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
183 | | - | |
| 183 | + | |
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| |||
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
249 | | - | |
| 249 | + | |
| 250 | + | |
250 | 251 | | |
251 | 252 | | |
252 | 253 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
| 203 | + | |
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| |||
0 commit comments