L
L
Leonid Tsarev2012-02-28 17:35:18
ASP.NET
Leonid Tsarev, 2012-02-28 17:35:18

ASP.net MVC - accept POST not in UTF-8?

My application uses UTF-8 everywhere and I don't want to change that. But: the old web gateway sends me a POST with text in the Windows1251 format. What is the easiest way to change the encoding of a single action of a single controller to Windows1251?

public class Message<br/>
{<br/>
 public int id { get; set; }<br/>
 public string phone { get; set; }<br/>
 public string mes { get; set; }<br/>
 public string to { get; set; }<br/>
}<br/>
<br/>
[HttpPost]<br/>
public ActionResult Receive(Message msg)<br/>
{<br/>
 AddIncomingMessage(msg);<br/>
 return new EmptyResult();<br/>
}<br/>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
RenderRR, 2012-02-28
@leotsarev

Edit input data in your ModelBinder?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question