Home > PHP Framework > YII > body text

How to solve Chinese garbled characters in yii framework

Release: 2019-12-23 16:02:08
Original
2810 people have browsed it

How to solve Chinese garbled characters in yii framework

Yii framework Chinese garbled solution:

1. The default encoding of Editplus may be ANSI, which needs to be changed to UTF-8.

Click "Tools"

How to solve Chinese garbled characters in yii framework

Select "Configuration User Tools"

How to solve Chinese garbled characters in yii framework

In the window that opens , select "File"

How to solve Chinese garbled characters in yii framework

Select the encoding method of the default encoding, as shown in the figure, select "utf-8", then click Confirm, exit the software, and then open the new default i.e. It is in utf-8 format

How to solve Chinese garbled characters in yii framework

2. Configure it like this in the database configuration:

<?php

return [
    &#39;class&#39; => &#39;yii\db\Connection&#39;,
    &#39;dsn&#39; => &#39;mysql:host=127.0.0.1; dbname=ohmycto; charset=utf8&#39;,
    &#39;username&#39; => &#39;website&#39;,
    &#39;password&#39; => &#39;mengde1B&#39;,
];
Copy after login

Recommended related articles and tutorials: yii tutorial

The above is the detailed content of How to solve Chinese garbled characters in yii framework. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template