Fixes #833: added charset to json response.

This commit is contained in:
Qiang Xue
2013-08-30 17:07:55 -04:00
parent 4d84e09479
commit 595ac6d0be

View File

@@ -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: