Commit e02c4a4
Fix potential encoding issue in STDIO transport
Explicitly specify StandardCharsets.UTF_8 in InputStreamReader
constructors for both server and client STDIO transports to ensure
consistent encoding regardless of the JRE default charset.
The MCP specification requires UTF-8 encoding for STDIO transport
messages. The outbound processing already uses UTF_8 explicitly, but
the inbound processing relied on the platform default charset, which
could cause encoding mismatches on non-UTF-8 systems.
Resolves #295
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 29dc250 commit e02c4a4
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