title: Dart Angular and JSON encoding
body: <p>I'm having and encoding issue on the application I'm working on. Is written in Angular Dart with Spring Boot on the backend.
  Those are variables i use for the request, along the header with the charset specified.</p>
  <pre><code>static final _headers = {'Content-Type': 'application/json; charset=utf-8', &quot;Access-Control-Allow-Origin&quot;: &quot;Origin&quot;};
  Uri _loginUri = new Uri(scheme: 'http', host: &quot;localhost&quot;, path: 'api/login', port: 8080);
  </code></pre>
  <p>This is how I call the method</p>
  <pre><code> Future&lt;LoginResponse&gt; login(String tessera, String password) async {
      try {
        final response = await _http.post(_loginUri, headers: _headers,
        body: json.encode({&quot;tessera&quot; : tessera, &quot;password&quot; : password}));
        print(response.body);
        return LoginResponse.fromJson(json.decode(response.body));
      } catch (e) {
        throw _handleError(e);
      }
    }
  
  class LoginResponse {
    String authToken;
    String sessionToken;
    int tessera;
    String firstName;
    String lastName;
  
    LoginResponse(this.authToken, this.tessera, this.firstName, this.lastName, this.sessionToken);
  
    factory LoginResponse.fromJson(Map&lt;String, dynamic&gt; response) {
      return LoginResponse(response['authToken'], response['tessera'], response['firstName'], response['lastName'], response['sessionToken']);
    }
  }
  </code></pre>
  <p>This is the answer the server give me</p>
  <pre><code>{&quot;errorMessage&quot;:null,&quot;sessionToken&quot;:&quot;2dc546d7-8f0a-435a-bc49-c64ae7de1d49&quot;,&quot;tessera&quot;:326,&quot;firstName&quot;:&quot;Valerio&quot;,&quot;lastName&quot;:&quot;Borsò&quot;,&quot;error&quot;:false}
  </code></pre>
  <p>But after the decoding I get the field last name with bad characters instead of the ò.</p>
  <pre><code>{&quot;errorMessage&quot;:null,&quot;authToken&quot;:&quot;2f69ad50-5124-44fd-8de0-54fb634a8435&quot;,&quot;sessionToken&quot;:&quot;f46fd67b-735f-4384-86a5-72d2863dd2ab&quot;,&quot;tessera&quot;:326,&quot;firstName&quot;:&quot;Valerio&quot;,&quot;lastName&quot;:&quot;BorsÃ²&quot;,&quot;error&quot;:false}
  </code></pre>