任何人都可以建议一个列出城市、电子邮件、电话等常见字段的建议最大长度的资源吗?
我知道电子邮件地址的长度限制为 254 个字符,但是是否有一个资源可以概述常见字段(例如电话、城市等联系信息)的建议最大长度?
似乎我所从事的每个项目中,人们都只是根据他们提出的限制而胡言乱语。我希望找到针对特定国家/地区的规范参考。
编辑 - 更新了每个评论的电子邮件最大长度。
I know email addresses are limited to 254 characters, but is there a single resource that outlines suggested maxlengths for common fields like contact information e.g. phone, city, etc?
It seems every project I work people just shoot from the hip on their proposed limits. I'm hoping to find a canonical reference, targeted to a specific country.
Edit - Updated email maxlength per comment.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我刚刚发现 HR-XML 联盟发布了他们的标准。也许他们的下载中有一些可以解决此类问题的内容。
http://www .hr-xml.org/hr-xml/wms/hr-xml-1-org/index.php?id={E00DA03B685A0DD18FB6A08AF0923DE0|139|2}
-- 原文 --
我之前在开始任何新项目后也遇到过这个问题。我在这里的回答只是基于经验。我认为没有规范的参考。如果您已有数据,您可以运行报告并查看任何字段的最大长度并添加一些填充。如果您要从多个国家/地区获取数据,则最大长度可能会根据国家/地区的不同而变化。
即使有一个基于国家/地区的规范列表也是不够的,因为存在 > 1 大多数国家的语言和文化,对于您所谈论的每个领域,每种语言和文化可能都有自己的“正常”长度。
我们应用一些常识:我们通常在 50 处截断地址字段。为什么?好吧,我无法想象有人拥有包含 50 个字符的地址(你怎么可能将其放入信封中)。
对于电话号码之类的内容,我们将其分解并为国家和城市代码提供自己的字段,以及区号。然后我们将电话号码限制为 15 个。同样,我从未见过电话号码(所有其他内容都被遗漏了)> 15.
出于同样的原因,如果将名称字段分解为名字/姓氏,则可能不需要 50 个字符,35 个字符就足够了。
I just found that the HR-XML Consortium posted their standards. Perhaps there is something in their download that addresses things like this.
http://www.hr-xml.org/hr-xml/wms/hr-xml-1-org/index.php?id={E00DA03B685A0DD18FB6A08AF0923DE0|139|2}
-- Original --
I've run into this problem before, after starting on any new project. And my answer here is just based off experience. I don't think there is a canonical reference. If you already have existing data, you could run a report and see what the max length is for any of the fields and add some padding. If you are going to be getting data from more than one country, then the max length may change based on the country.
Even if there was a canonical list based on country, it wouldn't be enough, because there exists > 1 language and culture in most countries, each possibly having their own "normal" lengths for each of the fields you are talking about.
Some common sense we apply: we usually cut off the address fields at 50. Why? well, I can't imagine anyone having an address that has 50 characters on it (how could you possibly fit that onto an envelope).
For things like phone numbers, we break it out and give the country and city codes their own fields, as well as for area codes. Then we cap the phone numbers at 15. Again, I've never seen a phone number (with all of the other stuff left out) > 15.
For the same reason, if you break up the name fields into first name/last name, you probably don't need 50 chars, 35 might suffice.
首先,除非您使用限制电子邮件的特定程序,否则电子邮件长度不能超过 320 个字符。您使用什么类型的脚本将输入推送到电子邮件?
其次,我从未在网上看到过具体的参考资料,但与我合作过的大多数开发人员都会将电话、电子邮件、姓名等
文本字段
限制为 50 个字符。很多时候textareas
不会有限制,但我总是建议 250-300 个字符,有时更短,具体取决于您期望的响应类型。First of all, unless you are using a specific program that is limiting your emails their is no reason why it cannot be longer than 320 characters. What type of script are you using to push inputs to email?
Second, I've never seen a specific reference online but most developers I've worked with will limit
textfields
such as phone, email, name to 50 characters. Many timestextareas
will not have limits, but I always recommend 250-300 characters, sometime shorter depending on the type of response you're expecting.