Commit 595ac6d0 by Qiang Xue

Fixes #833: added charset to json response.

parent 4d84e094
...@@ -781,7 +781,7 @@ class Response extends \yii\base\Response ...@@ -781,7 +781,7 @@ class Response extends \yii\base\Response
$this->content = $this->data; $this->content = $this->data;
break; break;
case self::FORMAT_JSON: 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); $this->content = Json::encode($this->data);
break; break;
case self::FORMAT_JSONP: case self::FORMAT_JSONP:
......
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