csharp-sdk/tests/ModelContextProtocol.Tests
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
..
Client Upgrade to xunit.v3 (#8) 2025-03-20 16:19:35 +02:00
Configuration Add initial support for Resource Templates (#18) 2025-03-21 14:09:45 -04:00
Protocol Fix enum serialization (#61) 2025-03-24 12:51:24 +00:00
Server Fix private reflection (#60) 2025-03-22 12:09:43 -04:00
Transport Fix stdio encoding issue: Enforce explicit UTF-8 for correct Unicode handling (#73) 2025-03-24 09:55:10 -04:00
Utils Address some static analysis and TODOs (#12) 2025-03-20 23:09:38 -04:00
ClientIntegrationTestFixture.cs Rename project and namespaces 2025-03-19 15:02:38 +02:00
ClientIntegrationTests.cs Logging Capability (#53) 2025-03-21 17:50:41 -04:00
EverythingSseServerFixture.cs Address some static analysis and TODOs (#12) 2025-03-20 23:09:38 -04:00
GlobalUsings.cs Rename project and namespaces 2025-03-19 15:02:38 +02:00
ModelContextProtocol.Tests.csproj Run integration test SSE server in process (#56) 2025-03-21 22:18:55 -04:00
SseIntegrationTests.cs Remove InternalsVisibleTo from main project. (#46) 2025-03-21 17:35:19 +00:00
SseServerIntegrationTestFixture.cs Run integration test SSE server in process (#56) 2025-03-21 22:18:55 -04:00
SseServerIntegrationTests.cs Upgrade to xunit.v3 (#8) 2025-03-20 16:19:35 +02:00