jquery表单验证器不能正确显示阿拉伯字母

jquery form validator not showing Arabic letters correctly

本文关键字:显示 阿拉伯 表单 验证 不能 jquery      更新时间:2023-09-26

我正在尝试使用jQuery表单验证,并且我希望验证文本为阿拉伯语。

问题是,当我在.js文件中更改该短语时,它显示的是正方形而不是阿拉伯字母。

这是我的js文件:
$(document).ready(function(){
    // Place ID's of all required fields here.
    required = ["name", "email", "country", "message"];
    // If using an ID other than #email or #error then replace it here
    email = $("#email");
    errornotice = $("#error");
    // The text to show up within a field when it is incorrect
    emptyerror = "Please fill out this field.";
    emailerror = "Please enter a valid e-mail.";

所以我想把最后两行"please fill…"answers"please enter…"改成阿拉伯语。

我已经试过添加这个代码:charset=UTF-8到头部,它仍然没有工作。

有什么办法解决这个问题吗?

这也发生在我身上。

然后我意识到我的编辑器使用了另一种编码…

把编辑器的编码改成utf-8