Both 1.php and HTML are utf-8
2.convention.php inside the ' default_charset ' and ' utf-8 ',
It's not 3.dbmysql.class.php $result [] = Auto_charset ($row, gb2312, UTF8)
Automatic conversion character set supports array conversion
function Auto_charset ($fContents, $from, $to) {
$from = Strtoupper ($from) = = ' UTF8 '? ' Utf-8 ': $from;
$to = Strtoupper ($to) = = ' UTF8 '? ' Utf-8 ': $to;
if (Strtoupper ($from) = = = Strtoupper ($to) | | empty ($fContents) | | (Is_scalar ($fContents) &&!is_string ($fContents))) {
If the encoding is the same or the non-string scalar is not converted
return $fContents;
}
if (is_string ($fContents)) {
if (function_exists (' mb_convert_encoding ')) {
Return mb_convert_encoding ($fContents, $to, $from);
}elseif (function_exists (' Iconv ')) {
Return Iconv ($from, $to, $fContents);
}else{
return $fContents;
}
}
ElseIf (Is_array ($fContents)) {
foreach ($fContents as $key = = $val) {
$_key = Auto_charset ($key, $from, $to);
$fContents [$_key] = Auto_charset ($val, $from, $to);
if ($key! = $_key) {
Unset ($fContents [$key]);
}
}
return $fContents;
}
else{
return $fContents;
}
}
Can't solve the-----of novice help
Reply to discussion (solution)
If you only query the database, you can remove Utf-8 data as long as set names UTF8. Of course. Your table must be UTF8 encoded.
PHP and HTML are utf-8.
Then execute the SQL command set names UTF8 after connecting to the database
Of course this refers to the case where the database is MySQL and the field is designed to support wide characters
PHP and HTML are utf-8.
Then execute the SQL command set names UTF8 after connecting to the database
Of course this refers to the case where the database is MySQL and the field is designed to support wide characters
Where is set names UTF8?? Which file of the Thinkphph folder is it?
' Default_charset ' = ' utf-8 ',//default output code
' Db_charset ' = ' utf8 ',//Database encoding defaults to UTF8
THINKPHPH don't need you set names UTF8
He'll do it himself.
Found the root of the two sentences Ah Rub
$job =m ("Form");
$list = $job->where ()->find ();
$job =m ("Form");
$list = $job->select ();
Nothing else has changed.
Novice Don't squirt
mysql_query (' Set names Utf-8 ');
Garbled, there must be a different character code, you may build the library when the code is not the same, you can view the library code, show create Datebase library name encoding consistent is not garbled