Commit dcf1966c authored by Taylor Otwell's avatar Taylor Otwell

Merge pull request #910 from franzliedke/patch-20

Force UTF-8 charset on JSON responses
parents 5c44cf98 db9f220f
...@@ -93,7 +93,7 @@ class Response { ...@@ -93,7 +93,7 @@ class Response {
*/ */
public static function json($data, $status = 200, $headers = array()) public static function json($data, $status = 200, $headers = array())
{ {
$headers['Content-Type'] = 'application/json'; $headers['Content-Type'] = 'application/json; charset=utf-8';
return new static(json_encode($data), $status, $headers); return new static(json_encode($data), $status, $headers);
} }
...@@ -113,7 +113,7 @@ class Response { ...@@ -113,7 +113,7 @@ class Response {
*/ */
public static function eloquent($data, $status = 200, $headers = array()) public static function eloquent($data, $status = 200, $headers = array())
{ {
$headers['Content-Type'] = 'application/json'; $headers['Content-Type'] = 'application/json; charset=utf-8';
return new static(eloquent_to_json($data), $status, $headers); return new static(eloquent_to_json($data), $status, $headers);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment