This question already has answers here:
UTF-8 all the way through
                                
                                    (15个答案)
                                
                        
                                2年前关闭。
            
                    
我正在通过$.POST发布UTF-8(印地语)数据。我在MySQL数据库中收到此消息:मनमोहन सिंह

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">


在页面中添加。

$.post("submit_answer_submit.php",
{
    qid: qidx,
    answer: answerx
},
function(data, status){


如何添加“ Content-Type:”?

最佳答案

当我添加“ $ result = mysqli_query($ connn,” SET NAMES'utf8'“);”时,问题已解决。在PHP中插入查询之前

关于javascript - 我正在通过$ .POST发布UTF-8(印地语)数据,并在我的计算机中获取此(मि mysql db ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/48335250/

10-09 19:03