title: Different character encoding in .net core class library
body: <p>I'm developing an API and are bumping in to a issue with character encoding. Consider the two following projects in a solution running .NET Core 2.1:</p>
  
  <ul>
  <li>MyApi.Web </li>
  <li>MyApi.Services</li>
  </ul>
  
  <p>This is the code from my controller in Web</p>
  
  <pre><code>[HttpGet("text")]
  public async Task&lt;JsonResult&gt; GetText()
  {
      string culture = CultureInfo.CurrentCulture.DisplayName;
      string encoding = Encoding.Default.ToString();
  
      string controllerText = culture + " " + encoding + " åäö";
      string serviceText = await _slotService.GetText();
  
      return _responseBuilder.Success("ControllerText: " + 
      controllerText + " ServiceText: " + serviceText);
  }
  </code></pre>
  
  <p>This is the code from my service:</p>
  
  <pre><code>    public async Task&lt;string&gt; GetText()
      {
          string culture = CultureInfo.CurrentCulture.DisplayName;
          string encoding = Encoding.Default.ToString();
          return culture + " " + encoding + " åäö";
      }
  </code></pre>
  
  <p>When I call this api from postman I get the following result:</p>
  
  <pre><code>{
      "message": "ControllerText: sv (SE) 
      System.Text.UTF8Encoding+UTF8EncodingSealed åäö ServiceText: sv 
      (SE) System.Text.UTF8Encoding+UTF8EncodingSealed 
      \ufffd\ufffd\ufffd"
  }
  </code></pre>
  
  <p>Why would the controller and service give different results for the "åäö" characters? Even though they seem to have the same culture and encoding. It must have something to do with them creating the strings in different projects (web project, and class library).</p>