mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-03 13:58:55 +08:00
Fixes #1631: Charset is now explicitly set to UTF-8 when serving JSON
This commit is contained in:
@ -799,7 +799,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=UTF-8');
|
||||
$this->content = Json::encode($this->data);
|
||||
break;
|
||||
case self::FORMAT_JSONP:
|
||||
|
||||
Reference in New Issue
Block a user