WCF Change message encoding from Utf-16 to Utf-8
问题 I have a WCF connected service in a .net core application. I'm using the code that is autogenerated taken the wsdl definition. Currently at the top of the request xml is including this line: <?xml version="1.0" encoding="utf-16"?> I can't find a simple way to change this encoding to UTF-8 when sending the request. Since I could find a configuration option a the request/client objects, I've tried to change the message with following code at IClientMessageInspector.BeforeSendRequest public