HTML5 电子邮件输入在 Chrome 39 中无法验证 utf-8

问题描述 投票:0回答:3

我的表单中有这个元素:

<input type="email" placeholder="Enter your e-mail">

当我输入

שלום@שלום.com
时,Google Chrome 39 会显示:

why?

但是为什么呢?我认为新的电子邮件地址可以包含 UTF-8 字符,因此这应该不是问题。

javascript html forms google-chrome utf-8
3个回答
2
投票

Chrome 或 HTML 规范似乎存在错误。看看这些:

这里有一个解决方法:使用

שלום@xn--9dbne9b.com
而不是
שלום@שלום.com


0
投票

您是否尝试过将

accept-charset="UTF-8"
添加到
form
标签中?


理想情况下,您在 Content-Type http 标头中设置 UTF-8:http://www.w3.org/International/O-HTTP-charset

或者作为 html 中的元标记:

<meta charset="utf-8">


0
投票

这是为了避免 SQL 注入。

cur.execute("select UNAME from users where EMAIL=? and UPASS=?",(email,pwd))

© www.soinside.com 2019 - 2024. All rights reserved.