-
Notifications
You must be signed in to change notification settings - Fork 379
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
Unwanted/Risky UTF8 Byte Order marks at the start of the http responses. #847
Comments
@myobis Nice catch! Thanks Mind checking out my PR to see if that fixes the issue? |
@andersjonsson , thanks for the fix. First, your fix does work for my client relying on UTF8: no more glitches 👌. I also have the following comment about your PR : I'm not a regular user of Unicode and BigEndianUnicode encodings. However, if it is similar to UTF8, I guess there should be no BOM at the start of the http response bodies for these encodings as well. You might want to adjust DefaultEncodings.cs accordingly. |
Since the charset is set to utf-16LE or utf-16BE in those cases I think you are correct. |
Further to minor glitches in some client code, I used Telerik Fiddler (HexView mode), to confirm that SoapCore is generating UTF8 Byte Order Marks at the very beginning of the http response bodies.
This is useless and possibly harmful.
The case that I noticed can be easily fixed in SoapEncoderOptions.cs replacing
Encoding.UTF8
bynew UTF8Encoding(encoderShouldEmitUTF8Identifier: false)
.This being said, there are plenty of other occurences of "Encoding.UTF8" in the code.. some are not a problem like
Encoding.UTF8.GetBytes(string)
, others might be.The text was updated successfully, but these errors were encountered: