0
我在我的應用程序中顯示這些字符時遇到問題。例如,在我的MySQL數據庫中,我有一行文本「Šauauaiaia」,在我的應用程序中,在文本字段中,它顯示爲「null」。如果我用其他「標準」字符替換「Š」,一切都可以。Š,Č,Ć,Đ,Ž沒有出現在Android應用程序
例如,「Ćća」顯示爲「?? a」。
任何人都可以告訴我,爲了解決這個問題,我應該在哪裏進行修改?
這是我給出的PHP腳本。
<?php
$host = "xxx.xxx.xxx"; // host of MySQL server
$user = "xxx"; // MySQL user
$pwd = "xxx"; // MySQL user's password
$db = "xxx"; // database name
// Create connection
$con = mysqli_connect($host, $user, $pwd, $db);
header('Content-Type: text/html; charset=UTF-8');
// Check connection
if(mysqli_connect_errno($con)) {
die("Failed to connect to MySQL: " . mysqli_connect_error());
}
$sql = "Select id as iii,kategorija as ooo,naslov as nnn,datum as ddd,urlN as uuu from vijesti where datum!='". $_POST["ustanova"]."' order by iii desc limit 0,20";
$result = mysqli_query($con, $sql);
// an array to save the application data
$rows = array();
// iterate to query result and add every rows into array
while($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
$rows[] = $row;
}
// close the database connection
mysqli_close($con);
// echo the application data in json format
echo json_encode($rows);
在此先感謝!
不是coppied問題,這些建議都沒有奏效! – Jovan