Last post Mar 25, 2014 05:45 AM by smirnov
Mar 25, 2014 04:50 AM|Just1n|LINK
I set the ReasonPhrase with chinese in server.
But it display as the messy code in client.
How should I do to show the correct chinese ReasonPhrase?
Here's my code:
var resp = Request.CreateResponse(HttpStatusCode.InternalServerError,e.Message);
resp.ReasonPhrase = e.Message;
throw new HttpResponseException(resp);
and the e.Message is chinese.
Mar 25, 2014 05:45 AM|smirnov|LINK
According to RFC 2616
Reason-Phrase = *<TEXT, excluding CR, LF>
"The TEXT rule is only used for descriptive field contents and values that are not intended to be interpreted by the message parser. Words of *TEXT MAY contain characters from character sets other than ISO-8859-1 only when encoded according to the rules
of RFC 2047”.
In other words, if you have characters other than ISO-8859-1 you need make them compliant with RFC 2047 http://www.faqs.org/rfcs/rfc2047.html