Skip to content

Commit 01460b0

Browse files
committed
fix: force UTF-8 encoding for stdio streams
This change forces $stdin/$stdout to use UTF-8 encoding, similar to PR 198 in the python-sdk. modelcontextprotocol/python-sdk#198 It addresses platform-dependent encoding issues.
1 parent 784b8b8 commit 01460b0

File tree

1 file changed

+2
-0
lines changed
  • lib/model_context_protocol/transports

1 file changed

+2
-0
lines changed

lib/model_context_protocol/transports/stdio.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ class StdioTransport < Transport
99
def initialize(server)
1010
@server = server
1111
@open = false
12+
$stdin.set_encoding("UTF-8")
13+
$stdout.set_encoding("UTF-8")
1214
super
1315
end
1416

0 commit comments

Comments
 (0)