PHP/AJAX:不能在AJAX响应中显示外部字符


PHP/AJAX : Can't display foreign character in ajax response

在我的数据库中,我有外国国家名称的特殊字符。我使用<meta charset="utf-8">在正常输入的特殊字符在html的正常工作。但是,当我调用ajax请求并使用html(data)将该特殊字符显示为特定的div时,文本正在更改为????? ??????? ?????。html

<div id="country_info"> </div>

js

$(document).on('change','#country_list', function(){
     var thisVal_id = $(this).val();
  $.ajax({
    url:'../ajax/paraphernalia/ajax_displayCountry_info.php',
    type:'post',
    data: {thisVal_id : thisVal_id , event_id : event_id},
    cache : false,
    success : function(data){
        $('#country_info').html(data);
    }
 });
});

response.php

//this select option contains different foreign characters
$output .= '<select id="official_name" class="form-control" style="padding:0px; !important">';
        while($row1 = mysql_fetch_assoc($sql1)){
            $output .= '<option value="'.$row1['name_official'].'">'.$row1['name_official'].'</option>';
        }
$output .= '</select>';
echo $output;

只要做一个小小的改变,这对我来说很有效。

$output .= '<select id="official_name" class="form-control" style="padding:0px; !important">';
    while($row1 = mysql_fetch_assoc($sql1)){
$name=mb_convert_encoding($row1['name_official'], 'HTML-ENTITIES', 'utf-8')
        $output .= '<option value="'.$name.'">'.$name.'</option>';
    }
$output .= '</select>';
echo $output;