Š, Č, Ć, Đ, Ž 未出现在 Android 应用程序中


Š, Č, Ć, Đ, Ž not appearing in Android application

我在应用程序中显示这些字符时遇到问题。例如,在我的MySQL数据库中,我有一行带有文本"Šauaiaia",在我的应用程序中,在文本字段中,它显示为"null"。如果我用其他"标准"字符替换"Š",一切都很好。

例如,"Ćć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);

提前感谢!

从 MySql 数据库中读取像 č ć đ š ž 这样的符号

我相信你的问题在这里得到了回答。似乎是问题的副本;Android不应该让它变得特别。