gpt4 book ai didi

php - 重音 "e"即使在元标记之后也显示为问号

转载 作者:行者123 更新时间:2023-11-29 18:12:54 27 4
gpt4 key购买 nike

我刚刚将一个我正在开发的网站放到网上,发现我所有的重音“e”(该网站是法语)都显示为问号。我进行了快速搜索并添加了

<meta charset="UTF-8">
<meta http-equiv="Content-type" content="text/html; charset=UTF-8">

但错误仍然存​​在。

正在从数据库加载文本,这是其结构的图片:

enter image description here

有问题的字段是“描述”,正如您所看到的,我选择了 utf8 作为其排序规则。我不禁注意到,在显示行统计信息的表中,它显示为 latin_swedish。不确定是否与此有关。感谢您的帮助。

选择描述的代码:

<?php include 'db_connect.php';
$modelID = mysqli_real_escape_string($connect,$_GET['m']); // Model ID, passed through URL

$query = mysqli_query($connect,"SELECT * FROM models WHERE id = ".$modelID);
if (mysqli_num_rows($query)==0) echo "Nothing found.<br/>";
while ($q = mysqli_fetch_array($query)) {
$picMain = $q['picture_url'];
$description = $q['description'];
$picDir = $q['picDir'];
}

// Create an array of images to pass to jQuery
$diaporama = array();
if ($handle = opendir('Images/'.$picDir)) {
while (false !== ($entry = readdir($handle))) {
if ($entry != "." && $entry != ".." && $entry != ".DS_Store") {
array_push($diaporama,$entry);
}
}
closedir($handle);
}

$randomPicID = array_rand($diaporama,1);
$randomPic = $picDir.$diaporama[$randomPicID];

$substring = substr($randomPic, 0, -5);



?>
<script type="text/javascript" src="JavaScript/general.js"></script>

<div id="GuitarBigWindow">

<div id="leftWindow" style="background-image: url('Images/<?php echo $picMain; ?>'); ">
<a href="notalink.html" id="infoButton">+ Information</a>
<div id="info" class="notVisible"><?php echo $description; ?></div>
</div>

<div id="rightWindow" style="background-image: url('Images/<?php echo $randomPic; ?>');"


onclick="

var enable = function() { counter++;

if (counter > 7) {counter = 1;}

$( '#rightWindow' ).css('background-image', 'url(Images/<?php

echo $substring;

?>' + counter + '.jpg)');}

enable();

this.style.pointerEvents = 'none';

$( '#rightWindow' ).on('transitionend',
function(e) {

this.style.pointerEvents = 'auto';

});

clearInterval(interval);
automatic();


"></div>

最佳答案

建立数据库连接后,尝试添加

$db_connection->set_charset("utf8");

(其中 $db_connection 代表您的连接)

关于php - 重音 "e"即使在元标记之后也显示为问号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47254608/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com