通过ajax正确显示MySQL和PHP中的汉字

How to properly display Chinese characters in HTML through ajax using PHP?

In the MySQL I have this data èŠ±æ ·å¹´åŽ, if I use PHP echo it shows 花样年华, but if I use ajax callback I get èŠ±æ ·å¹´åŽ (eventname), the ajax code is as below:

$.ajax({
    url: "action/getEvent.php",
    type: "POST",
    data: {'LoadEvent':''},
    dataType: "json",
    success: function(data) {
        if(data.eventname!=''){
            alert(data.eventname);
        }
    },
    error: function (xhr, ajaxOptions, thrownError) {
        console.log(xhr);
    }
});

Is it I need to do something on the data before saving into MySQL database? But why PHP is ok only ajax is not?

Could you try to set UTF-8 charset encoding on all of code sides, like AJAX requests[optional], PHP files with header() function, html files and also MySQL table fields charsets.