title: 'Malformed UTF-8 characters, possibly incorrectly encoded' in Laravel
body: <p>I'm using Laravel (a PHP framework) to write a service for mobile and have the data returned in <code>JSON</code> format. In the data result there are some fields encoded in <code>UTF-8</code>. </p>
  
  <p>The following statement</p>
  
  <pre><code>return JsonResponse::create($data); 
  </code></pre>
  
  <p>returns the error below</p>
  
  <pre><code>InvalidArgumentException
  HELP
  Malformed UTF-8 characters, possibly incorrectly encoded
  
  Open: /var/www/html/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/JsonResponse.php
          } catch (\Exception $exception) {
              restore_error_handler();
  
              throw $exception;
          }
  
          if (JSON_ERROR_NONE !== json_last_error()) {
              throw new \InvalidArgumentException($this-&gt;transformJsonError());
          }
  </code></pre>
  
  <p>I've changed:</p>
  
  <pre><code>return JsonResponse::create($data);
  </code></pre>
  
  <p>to</p>
  
  <pre><code>return JsonResponse::create($data, 200, array('Content-Type'=&gt;'application/json; charset=utf-8' ));
  </code></pre>
  
  <p>but it still isn't working.</p>
  
  <p>How can I fix it?</p>