title: How to change charset response header and response encoding for C# .net core web api json response?
body: <p>I have simple .net core wep api application with contoller method like that</p>
  
  <pre><code>   [HttpGet("{id}")]
      public ActionResult  Get(int id)
      {
          var myObj= _testRepository.TryGetById(id);
          if (myObj== null)
          {
              return new NotFoundResult();
          }
          return new JsonResult(myObj);
  
      }
  </code></pre>
  
  <p>This method return json response with headers</p>
  
  <pre><code>Content-Type    application/json; charset=utf-8
  Date    Sat, 26 Aug 2017 12:01:00 GMT
  Server  Kestrel
  Transfer-Encoding   chunked
  </code></pre>
  
  <p>I need to change <strong>charset=utf-8</strong> header to <strong>charset=utf-16</strong>. How can i do that?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I wanted to change <strong>charset</strong> header, because i needed to get string fields inside json response escaped like that</p>
  
  <pre><code>{ "city": "\u0420\u043e\u0441\u0431\u0438\u0440\u0441\u043a"}
  </code></pre>
  
  <p>This problem can be solved by changing code inside <code>Startup.cs</code></p>
  
  <pre><code>public void ConfigureServices(IServiceCollection services)
  {
      ...
      services.AddMvc();
      ...
  }
  </code></pre>
  
  <p>=></p>
  
  <pre><code>public void ConfigureServices(IServiceCollection services)
  {
      ...
      services.AddMvc().AddJsonOptions(options =&gt;
          {
              options.SerializerSettings.StringEscapeHandling =  StringEscapeHandling.EscapeNonAscii;
          });
      ...
  }
  </code></pre>
  
  <p>But I'm really confused, I have not found on the web any info about how to change default <strong>charset</strong> header. I think it must be trivial operation for any api framework.</p>