Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can anyone suggest a resource that lists suggested maxlengths for common fields like city, email, phone, etc?

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.

like image 868
Cory House Avatar asked Nov 15 '22 08:11

Cory House


1 Answers

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.

like image 180
NinjaCat Avatar answered Dec 09 '22 19:12

NinjaCat