From 595ac6d0beaed1ba95c9249262c003cc40a87802 Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Fri, 30 Aug 2013 17:07:55 -0400 Subject: [PATCH 1/2] Fixes #833: added charset to json response. --- framework/yii/web/Response.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/yii/web/Response.php b/framework/yii/web/Response.php index cfbc537..3599e63 100644 --- a/framework/yii/web/Response.php +++ b/framework/yii/web/Response.php @@ -781,7 +781,7 @@ class Response extends \yii\base\Response $this->content = $this->data; break; case self::FORMAT_JSON: - $this->getHeaders()->set('Content-Type', 'application/json'); + $this->getHeaders()->set('Content-Type', 'application/json; charset=' . $this->charset); $this->content = Json::encode($this->data); break; case self::FORMAT_JSONP: From 947a557240e6bf8eda4a1b41057d76874e7e0a49 Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Sat, 31 Aug 2013 08:15:10 -0400 Subject: [PATCH 2/2] Reverted changeset 595ac6d0beaed1ba95c9249262c003cc40a87802 --- framework/yii/web/Response.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/yii/web/Response.php b/framework/yii/web/Response.php index 3599e63..cfbc537 100644 --- a/framework/yii/web/Response.php +++ b/framework/yii/web/Response.php @@ -781,7 +781,7 @@ class Response extends \yii\base\Response $this->content = $this->data; break; case self::FORMAT_JSON: - $this->getHeaders()->set('Content-Type', 'application/json; charset=' . $this->charset); + $this->getHeaders()->set('Content-Type', 'application/json'); $this->content = Json::encode($this->data); break; case self::FORMAT_JSONP: