Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Comments

Close side panel

Fix potential encoding issue in STDIO transport#825

Closed
xxxxxxjun wants to merge 1 commit intomodelcontextprotocol:mainmodelcontextprotocol/java-sdk:mainfrom
xxxxxxjun:fix/stdio-encoding-inconsistencyxxxxxxjun/java-sdk:fix/stdio-encoding-inconsistencyCopy head branch name to clipboard
Closed

Fix potential encoding issue in STDIO transport#825
xxxxxxjun wants to merge 1 commit intomodelcontextprotocol:mainmodelcontextprotocol/java-sdk:mainfrom
xxxxxxjun:fix/stdio-encoding-inconsistencyxxxxxxjun/java-sdk:fix/stdio-encoding-inconsistencyCopy head branch name to clipboard

Conversation

@xxxxxxjun
Copy link

@xxxxxxjun xxxxxxjun commented Feb 21, 2026

No description provided.

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 modelcontextprotocol#295
@xxxxxxjun xxxxxxjun force-pushed the fix/stdio-encoding-inconsistency branch from e02c4a4 to 02999b9 Compare February 21, 2026 08:47
@xxxxxxjun xxxxxxjun closed this Feb 21, 2026
@xxxxxxjun xxxxxxjun deleted the fix/stdio-encoding-inconsistency branch February 21, 2026 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.