通过jquery ajax方法提取的值中的字体字符问题

I am using jquery ajax to display some values inside the label when some value is selected from select box. but the value that i want to display in label is some different font and I think that is why the value is displayed with some question mark characters with black quad box as background [#nb-am-h��#w] . How to avoid this:

//Javascript code
<script type="text/javascript">
    $("document").ready(function(){
        var id=$(this).val();
        //alert(id);

        $.ajax({
            type: "POST",
            url: "ajax.php",
            data: {id:id},
            cache: false,
            success: function(html){
                //alert(html);
                $("#malid").show();
                /*$('#malid').css("font-family", "malfont");*/
                $("#malid").html(html);
            } 
        });
    );

HTML code

<div>
  <label>Book</label>
  <select id="bookname">
  <?php 
      for($i=0;$i<$count;$i++)
      {
      ?>
           <option  value="<?php echo $bookid[$i];?>"><?php echo    $book_name[$i];?> </option>
      <?php
      } 
  ?>
  </select>
  <label id="malid" style="display:none;font-family: 'malfont';"></label>
 </div>

//Php code inside ajax.php
if(isset($_POST['id']))
{
    $id=$_POST['id'];

    $book_results = $mysqli->query("SELECT book FROM booktable where book_id='$id'");
    $row = $book_results->fetch_assoc();
    $book = $row['book'];
    echo $book;  
} 

I got a solution for my issue. I just included the below line in my Ajax page and it is working fine now.

header('Content-Type: text/html; charset=ISO-8859-15');

Can you check out (using the networks tab or a proxy) what the response is from the AJAX call? Its probably bad encoding in your database / connection.

Also, please note that this AJAX endpoint is vulnerable for SQL Injection (You're not escaping the users' input $_POST['id'].

For more information, check out: https://en.wikipedia.org/wiki/SQL_injection#Technical_implementations