Html5形式模式拉丁字符声音áéíóúÇçü [英] Html5 form pattern latin characters vocals áéíóú Çç ü

查看:223
本文介绍了Html5形式模式拉丁字符声音áéíóúÇçü的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试验证输入表单html5,它在我的本地Web服务器中工作,但当上传到主机不工作在这些字符:重音字符(声乐)像áéíóú。

i'm trying to validate input form html5, it works in my local web server, but when upload to hosting doesnt work in this characters: accented characters (vocals) like áéíóú.

所以我试过改变编码,这是最好的做法吗?

so i have tried changing the encoding, is this the best practice?

<META HTTP-EQUIV="Content-Type" CONTENT="text/html;" charset="ISO-8859-1">
<html>
<head></head>
    <body>
        <form>
        Input:<input type="text" pattern="[a-zA-Z0-9ñÑáéíóúü\-_çÇ& ]+"  required />
        <input type="submit" />
        </form>
    </body>
</html> 


推荐答案

元标记描述的字符集不是页面

The charset described by the meta tag is not the page's encoding, it's just your claim of what the encoding is.

页面的实际编码是您在文本编辑器中使用的任何编码,保存文件。

The actual encoding of the page is whatever encoding you used in your text editor to save the file. It is also possible that the hosting changes the encoding of the file but probably unlikely.

你可能希望你的标签只是:

You probably want your tag just to be:

<meta charset="UTF-8">

请务必确保以UTF-8编码保存文件。 (通常在另存为对话框中的编码)

Remember to ensure that you save the file in UTF-8 encoding. (Usually "Encoding" in Save As-dialog)

这也可能是主机发送一个实际的HTTP头使用字符集 - 这将覆盖您拥有的任何元标记。您可以使用Google Chrome开发者工具网络标签查看是否是这种情况。

It is also possible that the hosting is sending an actual HTTP header with charset - this will override any meta tag you have. You can see if this is the case by using Google Chrome Developer Tools Network tab for example.

这篇关于Html5形式模式拉丁字符声音áéíóúÇçü的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆