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. https://github.com/modelcontextprotocol/python-sdk/pull/198 It addresses platform-dependent encoding issues.
This commit is contained in:
parent
784b8b8548
commit
01460b0b4f
1 changed files with 2 additions and 0 deletions
|
|
@ -9,6 +9,8 @@ module ModelContextProtocol
|
|||
def initialize(server)
|
||||
@server = server
|
||||
@open = false
|
||||
$stdin.set_encoding("UTF-8")
|
||||
$stdout.set_encoding("UTF-8")
|
||||
super
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue