Browse Source

Force UTF-8 charset on JSON responses.

Franz Liedke 12 years ago
parent
commit
db9f220f57
1 changed files with 2 additions and 2 deletions
  1. 2 2
      laravel/response.php

+ 2 - 2
laravel/response.php

@@ -93,7 +93,7 @@ class Response {
 	 */
 	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);
 	}
@@ -113,7 +113,7 @@ class Response {
 	 */
 	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);
 	}