-
Notifications
You must be signed in to change notification settings - Fork 315
[5.1] Use UTF8 instance that doesn't emit BOM #3617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release/5.1
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR ports a UTF-8 encoding fix from the main branch to release/5.1. The fix addresses an issue where UTF-8 encoding operations were including a Byte Order Mark (BOM) when they shouldn't, which could cause data corruption or incorrect encoding behavior in SQL Server bulk copy operations.
Key changes:
- Replaces direct use of
Encoding.UTF8
with a custom UTF-8 encoder that doesn't emit BOM - Adds comprehensive test coverage for UTF-8 bulk copy scenarios
- Updates both .NET Framework and .NET Core implementations consistently
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
TestBulkCopyWithUTF8.cs | New test file that validates UTF-8 bulk copy operations preserve byte sequences correctly |
Microsoft.Data.SqlClient.ManualTesting.Tests.csproj | Adds the new test files to the project compilation |
DataTestUtility.cs | Adds helper method for creating test tables with specific column definitions |
netfx/src/Microsoft/Data/SqlClient/TdsParser.cs | Replaces UTF-8 encoding instances with BOM-less version in .NET Framework implementation |
netcore/src/Microsoft/Data/SqlClient/TdsParser.cs | Replaces UTF-8 encoding instances with BOM-less version in .NET Core implementation |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/5.1 #3617 +/- ##
===============================================
+ Coverage 65.77% 65.97% +0.19%
===============================================
Files 293 293
Lines 61647 61649 +2
===============================================
+ Hits 40547 40671 +124
+ Misses 21100 20978 -122
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Afaik, this will need to have the branch merged into it to pick up CI changes once they go through. |
Description
Ports #3399 to release/5.1
Issues
#3397
Testing
Port contains the testcase to validate the fix