I am using HTTP headers to send a string which contains Unicode characters (such as ñ
) to a custom http server.
When I add the string as a header:
webClient.Headers.Add("Custom-Data", "señor");
It is interpreted by the server as:
se�or
Obviously I need to encode the value differently, but I am unsure what encoding to use.
How should I encode this HTTP header to preserve extended/special characters?
- porneL's answer to a related question is confusing.
- Unanswered, related: C# WebClient non-english request header value encoding