csharp-sdk/tests/ModelContextProtocol.Tests/Transport
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Brandon Williams 36d5019de0
Fix stdio encoding issue: Enforce explicit UTF-8 for correct Unicode handling (#73)
* fix: Enforce UTF-8 encoding for stdio transport

This change replaces the default system encoding with an explicit UTF8Encoding (without BOM)
for both client and server transports. This ensures proper handling of Unicode characters,
including Chinese characters and emoji.

- Use UTF8Encoding explicitly for StreamReader and StreamWriter.
- Add tests for Chinese characters ("上下文伺服器") and emoji (🔍🚀👍) to confirm the fix.

Fixes #35.

* Remove relaxed JSON encoder

* Address PR feedback

---------

Co-authored-by: Stephen Toub <stoub@microsoft.com>
2025-03-24 09:55:10 -04:00
..
SseClientTransportTests.cs Fix private reflection (#60) 2025-03-22 12:09:43 -04:00
StdioServerTransportTests.cs Fix stdio encoding issue: Enforce explicit UTF-8 for correct Unicode handling (#73) 2025-03-24 09:55:10 -04:00