IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Phone numbers and i18n
That's "internationalization", for the uninitiated.

I'm working on a JSP/Struts based web application. We're attempting to build in i18n from the get-go, since this is a new project.[0]

A topic of discussion came up this morning regarding phone numbers, and how to display them in our JSP pages. Another person on the team offered his initial opinion that all phone numbers should be displayed based on the Locale of the person viewing them.

My argument against this is that a phone number is tied to a location, and should not be reformatted based upon who is viewing it. All US phone numbers should display as (123) 456-7890, no matter whether the person viewing the web page is in the US or Mexico. In the database, as well as in our business object layer, my contention is that this number should be stored as a single unformatted String: "1234567890".

I further suggested a couple of other ideas.

  1. That in order to get a formatted phone number back, all that our JSP should have to do is call the toString() method on the PhoneNumber object that we're given (whether that's composited as part of a Person object, or distinct from it is outside this discussion.)

  2. That we should have an entire class hierarchy of different PhoneNumber objects, perhaps with AbstractPhoneNumber as the base class, and then USPhoneNumber, MexicanPhoneNumber, etc as subclasses thereof. Each would then provide their own implementation of toString(), as well as any additional methods that might be helpful (for example, getAreaCode() for a US Phone Number.)

  3. That this class hierarchy should be encapsulated inside Factory Pattern to instantiate and handle each different kind of phone number based on where it's located[1].



So, in thinking about this, I realized that this has to be a solved-problem already. Unfortunately, Googling for "phone number factory" is less than helpful. A second Google for "phone number factory Java" turned up [link|http://www.sys-con.com/story/?storyid=46239&DE=1|this] nugget...Which tells me that at least someone agrees that I'm on the correct path.

But I also seek the IGM input. This is the first application where I've had to deal with i18n. What say you?

[0] Unfortunately, there's also some legacy code that will be accessing our database from the get-go as well...And further integration of legacy code/objects further on down the line.

[1] The details of this I've yet to work out.
-YendorMike

"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety."
- Benjamin Franklin, 1759 Historical Review of Pennsylvania
New Only thing I would question
is whether you should consider putting in the country number or not.
--\n-------------------------------------------------------------------\n* Jack Troughton                            jake at consultron.ca *\n* [link|http://consultron.ca|http://consultron.ca]                   [link|irc://irc.ecomstation.ca|irc://irc.ecomstation.ca] *\n* Kingston Ontario Canada               [link|news://news.consultron.ca|news://news.consultron.ca] *\n-------------------------------------------------------------------
New If you want to make your display useful
you need to show the number "ready for dialing".

That, of course, means prepending location-specific "9", "1" or "011"(?) code. And ommiting area code for local calls that must have it ommitted.

Or, for some reports, you'd have to show it in the most generic format, as in +(country)-(area)-(phone)

What I am trying to say, you need to support a whole lot of ways to render the phone if you really want to do it right. And storing it as a bunch of digits will probably not work.
--


And what are we doing when the two most powerful nations on earth -- America and Israel -- stomp on the elementary rights of human beings?

-- letter to the editor from W. Ostermeier, Liechtenstein

New What else could you store it as?
===

Purveyor of Doc Hope's [link|http://DocHope.com|fresh-baked dog biscuits and pet treats].
[link|http://DocHope.com|http://DocHope.com]
New Re: If you want to make your display useful
you need to show the number "ready for dialing".

That, of course, means prepending location-specific "9", "1" or "011"(?) code. And ommiting area code for local calls that must have it ommitted.

Or, for some reports, you'd have to show it in the most generic format, as in +(country)-(area)-(phone)
Good points. I'll have to take that into consideration. Perhaps more getter methods for display only.

What I am trying to say, you need to support a whole lot of ways to render the phone if you really want to do it right. And storing it as a bunch of digits will probably not work.
So....How would *you* store it, then?
-YendorMike

"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety."
- Benjamin Franklin, 1759 Historical Review of Pennsylvania
New Country code, area code, main number, extension
--


And what are we doing when the two most powerful nations on earth -- America and Israel -- stomp on the elementary rights of human beings?

-- letter to the editor from W. Ostermeier, Liechtenstein

New Re: Phone numbers and i18n
My argument against this is that a phone number is tied to a location, and should not be reformatted based upon who is viewing it. All US phone numbers should display as (123) 456-7890, no matter whether the person viewing the web page is in the US or Mexico. In the database, as well as in our business object layer, my contention is that this number should be stored as a single unformatted String: "1234567890".

Do you have to handle extensions? It can be hard to tell (123)456-7890 from 123-4567 ext 890 in an unformatted string.

And where are you storing the country information? You really have to associate it with each phone number some how, because if your going to the trouble of handeling international phone numbers you should also handle companies and people that have phone numbers in multiple countries.

You should probably do some research on international standards, I know there is a standard for phone numbers that goes something like +country code-area code-sub code-remaining digits.

Jay
New Re: Phone numbers and i18n
Do you have to handle extensions? It can be hard to tell (123)456-7890 from 123-4567 ext 890 in an unformatted string.
Good question. I hadn't considered the possiblity of extensions yet (the code for writing the PhoneNumber class is not in my domain on this project; it's just an example that a co-worker and I discussed this morning, so it's what I used here.) My initial thought is that that would be another member on the object, possibly blank, and stored as only numbers inside a String, similar to how I've proposed storing the phone number itself.

And where are you storing the country information? You really have to associate it with each phone number some how, because if your going to the trouble of handeling international phone numbers you should also handle companies and people that have phone numbers in multiple countries.
You are absolutely correct in this. The country would need to be stored with the phone number itself so that we know 1) which class to produce out of the factory, and 2) how to format it (which inherently falls out of 1) above.)

You should probably do some research on international standards, I know there is a standard for phone numbers that goes something like +country code-area code-sub code-remaining digits.
I'll go look into that; didn't really know that there was a "standard" as such. Thanks.
-YendorMike

"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety."
- Benjamin Franklin, 1759 Historical Review of Pennsylvania
New Basically, you're totally wrong, and your colleague right.
YendorMike writes:
[i18n] That's "internationalization", for the uninitiated.
Yeah, and isn't it annoying as all Hell when everybody just uses that, but nobody tells you HOW the fuck exactly "i18n" is supposed mean to "internationalization"? I tried to pronounce "Eyeeighteennnn" with various accents and in different tones of voice, but I could'nt for the life of me understand it...

Only last week did it strike me that 'internationalization' has twenty letters -- an 'i', eighteen various and sundry other letters, and an 'n'! (By the same token, I've seen " L10N" used for "localization".)

There, hopefully I've now helped spare someone some of the same mental agony I went through! :-)

Then we get to his point:
Another person on the team offered his initial opinion that all phone numbers should be displayed based on the Locale of the person viewing them.

My argument against this is that a phone number is tied to a location, and should not be reformatted based upon who is viewing it. All US phone numbers should display as (123) 456-7890, no matter whether the person viewing the web page is in the US or Mexico.
You're totally wrong. The reasons *why* you are totally wrong are:

1) A telephone number's main function is not just to be viewed; it is supposed to be *used* (by dialling it).

2) The funny formatting is a convention that tells the prospective caller *how* to use it (specifically, mainly as to which parts he can omit depending on where he is; but also, and in this case more importantly, where he should pause and listen for a renewed dial tone).

3) The person viewing the telephone number in his Web browser in Mexico -- or Abu Dhabi or Norway or whatever -- is probably viewing it not just for fun, but because *he* is a prospective caller, so *he* needs to know how to use it.

Personally -- and remember that I'm speaking as a Scandinavian, i.e pretty much an expert on American popular "culture" compared to much of the rest of the world -- I've never understood the weird Yank convention of writing telephone numbers as "(123) 456-7890" and so on. How much of that is the area code? One would think, just the bit in parentheses -- but then WTF is the dash all about? And do I dial it all in one fell swoop, without pausing for a dial tone at any point? If so, then why have any weird delimiters at all? And if not, then where do I pause -- at the dash? After the bit in parentheses? Both? Neither? Who the fuck knows...

And if I am this clueless -- I, who at least know why the bit before the dash is almost always "555" on film and TV -- then just imagine what shade of confused you can colour your average Burundian or Burmese.

Anyway, to recap: Phone numbers are formatted to tell the user how to use them, and not all users are helped by the American formatting conventions.

HTH!



Now, if you wanted to just one single format, then why not use the standard? You may not know it; I didn't, until my old net.acquaintance Julian Macassey told me once -- back around the turn of the century it was, I think -- but there is actually an international standard for how to format telephone numbers. IIRC, your example should become something like "1.123.456.7890", according to Julian. Now, you don't know mr Macassey from Adam -- but how could you *not* believe a man whose domain is [link|http://tele.com|tele.com]? :-)

A quick bit of Googling shows that Julian was pretty much right:

The Global Web Architecture Group (whatever that is) has a [link|http://www.globalwebarch.com/freesite/RDBMS-GG-C04-3.html|Web Globalization Guide Framework, by the Relational Logistics Group] which says, about halfway down the page, "Examples with Punctuation and Segments: + 1.480.368.1799 USA".

Hmm... I could have sworn I saw some examples somewhere, where spaces were used in stead of the periods.

Not to worry, though -- for only 20 CHF (Swiss Francs), the [link|http://www.itu.int/rec/recommendation.asp?type=items&lang=E&parent=T-REC-E.123-200102-I|ITU - the International Telecommunications Union] is ready and willing to sell you the complete specs of the international standard, in any one of three languages and two file formats.

Even [link|http://www.microsoft.com/globaldev/getwr/steps/wrg_telnum.mspx|Microsoft] comments on the issue, but they only go from "the format for telephone numbers around the world varies significantly" at the top of the page, to "The current implementation of NLS APIs and the .NET Framework do not provide any telephone-number formatting information. ... (You will need to do your own parsing for these separators.)"

I suppose you'd be better off using something called [link|http://www.liferay.com/|Liferay Portal]. At least this [link|http://forums.liferay.com/index.php?showtopic=813|support forum thread] and this [link|http://support.liferay.com/browse/LEP-212|CVS commit log] show not only that they know about the problem, but they're actually doing something about it.

As usual, Wikipedia has an exhaustive (read that however you will...) entry on the issue, entitled [link|http://en.wikipedia.org/wiki/Area_code|Telephone numbering plan].

But, to summarise: Phone numbers are formatted to tell the user how to use them, and not all users are helped by the American formatting conventions.

HTH!


   [link|mailto:MyUserId@MyISP.CountryCode|Christian R. Conrad]
(I live in Finland, and my e-mail in-box is at the Saunalahti company.)
Your lies are of Microsoftian Scale and boring to boot. Your 'depression' may be the closest you ever come to recognizing truth: you have no 'inferiority complex', you are inferior - and something inside you recognizes this. - [link|http://z.iwethey.org/forums/render/content/show?contentid=71575|Ashton Brown]

(*): Apparently, because it's never used in real life. (i.e, if I understand correctly, so ordinary people won't be harassed by total morons trying to call movie or TV characters.)
New American users are helped by it
The bit in parentheses is the area code, which you only need[0] to dial if you're calling from a different area code.[1] And everyone (here) knows that if you do need the area code then you need to dial a 1 first,[2] and if you don't need the area code you don't need the 1.[3]

Parens for an optional part seems reasonable. And for local advertising, where they expect everyone seeing the ad is from the same area code, it is frequently left off entirely.

And the reason for the dash in the middle is that the first three were origianlly used for localization. Ever heard the old swing standard "Pennsylvania 6-5000"? Ever wonder what the hell it meant? It was a phone number: PA6-5000. That's what the letters on the dial were for, not catchy 800 numbers.


[0] Well, usually need.

[1] Unless you need to dial it anyway.

[2] Unless you don't.

[3] Unless you do.
===

Purveyor of Doc Hope's [link|http://DocHope.com|fresh-baked dog biscuits and pet treats].
[link|http://DocHope.com|http://DocHope.com]
New In Charlotte, and surrounding area,...
we have for a long as I've been here area code 704. Now, we have an "overlay" area code 980. What that means is that to call your neighbor you always need to dial 10 digits. I know of no one that actually has the 980 area code.

What's peculiar is that one would think long distance calls could be made by just dialing the 10 digits. But, no! You have to dial 1 first.

With (Verizon) cell phones, the 10 digit long distance calling works fine.

In any case, for years I've disliked the use of parens around the area codes as being wasteful (being they're often bracketed by spaces as well, e.g. (704) 666-1234 ) so my PDA phone numbers look like - 704.666.1234
Alex

The trouble with the world is that the stupid are cocksure and the intelligent are full of doubt. -- Bertrand Russell
New No
Denver has 10 digit dialing - so does Seattle, but San Francisco has 7 digit dialing. Frankly, I'd like to see national 7 digit dialing replaced with 10 digit dialing and the leading "1" eliminated for good withing the country.






"Whenever you find you are on the side of the majority, it is time to pause and reflect"   --Mark Twain

"The significant problems we face cannot be solved at the same level of thinking we were at when we created them."   --Albert Einstein

"This is still a dangerous world. It's a world of madmen and uncertainty and potential mental losses."   --George W. Bush
New True, if everything's 10-digit no need for the '1'
===

Purveyor of Doc Hope's [link|http://DocHope.com|fresh-baked dog biscuits and pet treats].
[link|http://DocHope.com|http://DocHope.com]
New the leading one is to route to a stp for long distance
resolution if you dial a not local area code plus number it fails, try it :-)
thanx,
bill
All tribal myths are true, for a given value of "true" Terry Pratchett
[link|http://boxleys.blogspot.com/|http://boxleys.blogspot.com/]

Any opinions expressed by me are mine alone, posted from my home computer, on my own time as a free american and do not reflect the opinions of any person or company that I have had professional relations with in the past 48 years. meep
questions, help? [link|mailto:pappas@catholic.org|email pappas at catholic.org]
New I know why its there
I've written residential provisioning software for 5E switches.

But if they can do an overlay network, they can make the whole US one overlay network and eliminate the leading 1 that sometimes you dial and sometimes you don't.



"Whenever you find you are on the side of the majority, it is time to pause and reflect"   --Mark Twain

"The significant problems we face cannot be solved at the same level of thinking we were at when we created them."   --Albert Einstein

"This is still a dangerous world. It's a world of madmen and uncertainty and potential mental losses."   --George W. Bush
New duh, forgot about that :-)
but that is just an AIN change and some switch software, also if you query local for routing you get to keep the dip money, so such changes would make sense.
thanx,
boxley
All tribal myths are true, for a given value of "true" Terry Pratchett
[link|http://boxleys.blogspot.com/|http://boxleys.blogspot.com/]

Any opinions expressed by me are mine alone, posted from my home computer, on my own time as a free american and do not reflect the opinions of any person or company that I have had professional relations with in the past 48 years. meep
questions, help? [link|mailto:pappas@catholic.org|email pappas at catholic.org]
New Here too
Houston's got three area codes now with 10 digit dialing.

The 1 does serve a useful purpose with land-lines, it's a way to acknowledge that the call is long distance(and thus has an extra charge). Eliminiting it with mobiles makes sense though as it'd be difficult to keep track of when it was needed.
Darrell Spice, Jr.                      [link|http://spiceware.org/gallery/ArtisticOverpass|Artistic Overpass]\n[link|http://www.spiceware.org/|SpiceWare] - We don't do Windows, it's too much of a chore
New Well, (probably because I'm a contrarian)
...I'd like to go to the German form, adapted, of course, for U.S. audiences:

1) If you're dialling to the same exchange, all you need is the last 4 digits...the rest of the number is optional.

2) If you're dialling to a different exchange but in the same area code (even if you're in an overlaid area, you fuckheads at the FCC!), all you need is the 7 digits that comprise the exchange and the number...the rest of the number is optional

3) If you're dialling outside of your area code, you dial 1, then the entire 10 digit number

4) If your dialling out of the country, dial 011, then the country code, then the entire target number (which may vary widely in number of digits....)

Our idiot fuckhead FCC thinks this scheme is too "confusing". I find that insulting that a scheme that is too "confusing" for us here in the states today is: 1) actually an re-introduction of a scheme from a timewhen telephones were not as ubiquitous as they are today, and was therefore not so "confusing" say a generation or two ago, and 2) perfectly logical and functional or the entire rest of the world (give or take a few outliers...).
jb4
shrub\ufffdbish (Am., from shrub + rubbish, after the derisive name for America's 43 president; 2003) n. 1. a form of nonsensical political doubletalk wherein the speaker attempts to defend the indefensible by lying, obfuscation, or otherwise misstating the facts; GIBBERISH. 2. any of a collection of utterances from America's putative 43rd president. cf. BULLSHIT

New Note on "overlaid" area codes.
I'm coming to the conclusion that is a universally bad idea.

About 10 or 15 years ago, Australia realized we were going to run out of numbers in several major centres (e.g. Sydney) and we had to do something. So they looked at what everyone else was doing. The US was creating additional area codes, often right on top of existing ones. The UK was (AFAIR) also creating extra codes but was splitting regions. Our number regulator didn't like either approach. They cited end-user problems and confusion in dialling - exactly the problems you guys have noted.

We went in a different direction: we reduced the number of area codes, and increased all local numbers to 8 digits. Now the whole of NSW is 02, whereas formerly about 70% of Sydney was. Non-Sydney areas that were 04x or 06x and six digits became 02 and the 4x or 6x moved onto the start of their old number. Sydney numbers all gained a 9. And I've been seeing numbers starting with an 8 for a while now. In fact, Sydney and Melbourne each gained over 5 million new numbers so it will be a long time before we run out again.

Wade.

Is it enough to love
Is it enough to breathe
Somebody rip my heart out
And leave me here to bleed
 
Is it enough to die
Somebody save my life
I'd rather be Anything but Ordinary
Please

-- "Anything but Ordinary" by Avril Lavigne.

New Houston did both
When our 2nd area code was added, the city was split with 713 for addresses inside the beltway and 281 for those outside. There was a lot of expense for those businesses with new numbers - having to print up new letterhead, notify customers, etc.

When the 3rd area code was added they went with the overlay plan due to all of the complaints about the costs from before.

My thoughts on the matter was they should just have added 1 extra digit to the end of the phone number and increase the amount of numbers 10 fold. Any existing number would have a 0 as the new last digit, so if you saw an old-style number anywere you could still dial it by adding a 0 to the end.
Darrell Spice, Jr.                      [link|http://spiceware.org/gallery/ArtisticOverpass|Artistic Overpass]\n[link|http://www.spiceware.org/|SpiceWare] - We don't do Windows, it's too much of a chore
New Sounds like they didn't give enough notice.
The Australian public had *years* of notice. And the details about *each* step of the migration was public. We had some media flurry when the first 8-digit numbers appeared due to PABX software not understanding 8-digit numbers, but the regulatory authority's response was pretty much "you've known for years that it was happening - it's not out fault you won't upgrade your PABX software".

Wade.

Is it enough to love
Is it enough to breathe
Somebody rip my heart out
And leave me here to bleed
 
Is it enough to die
Somebody save my life
I'd rather be Anything but Ordinary
Please

-- "Anything but Ordinary" by Avril Lavigne.

New wasn't much
if [link|http://frodo.bruderhof.com/areacode/|this] list is correct then it was 8 months.
11/02/1996 - 06/07/1997 Area Code 281 : splits off area code 713 in Texas

Looks like most lead time was less than a year in the states.
Darrell Spice, Jr.                      [link|http://spiceware.org/gallery/ArtisticOverpass|Artistic Overpass]\n[link|http://www.spiceware.org/|SpiceWare] - We don't do Windows, it's too much of a chore
New Re: Houston did both
When our 2nd area code was added, the city was split with 713 for addresses inside the beltway and 281 for those outside. There was a lot of expense for those businesses with new numbers - having to print up new letterhead, notify customers, etc.

When the 3rd area code was added they went with the overlay plan due to all of the complaints about the costs from before.

Pennsylvania gave up on splitting areas because numbers where being added so fast they couldn't keep up. That seems to have peaked though, the real problem was back in the 80's when home users started using multiple numbers. Between cell phones, modems and faxes, even home users might have 3 or 4 numbers.

Jay
New The reason our "Bell system" will NEVER increase...
...the number of digits in a phone number has to do with the classic "rule of 7" which their own researchers discovered. Since it's their discovery, they will stick with it come hell or high water. (Oh, and that plus the fact that it would be "confusing"...)
jb4
shrub\ufffdbish (Am., from shrub + rubbish, after the derisive name for America's 43 president; 2003) n. 1. a form of nonsensical political doubletalk wherein the speaker attempts to defend the indefensible by lying, obfuscation, or otherwise misstating the facts; GIBBERISH. 2. any of a collection of utterances from America's putative 43rd president. cf. BULLSHIT

New rule of 7 is long gone
we're on 10 digit dialing afterall...
Darrell Spice, Jr.                      [link|http://spiceware.org/gallery/ArtisticOverpass|Artistic Overpass]\n[link|http://www.spiceware.org/|SpiceWare] - We don't do Windows, it's too much of a chore
New Yes, of course
But still, the rule of seven has already been invoked to shut down the 8-digit solution.

For me, I don't really see the diffeence between "duh-duh-DUH...duh-duh-DUH...duh-duh-duh-DUH" and "duh-duh-DUH...duh-duh-duh-DUH...duh-duh-duh-DUH". But then, I don't find the Germanic system particularly "confusing' either. Like I said, I'm a contrarian. (And I like to think I have an IQ somewhere above 75, which seems to be the average for Murikans these days.)
jb4
shrub\ufffdbish (Am., from shrub + rubbish, after the derisive name for America's 43 president; 2003) n. 1. a form of nonsensical political doubletalk wherein the speaker attempts to defend the indefensible by lying, obfuscation, or otherwise misstating the facts; GIBBERISH. 2. any of a collection of utterances from America's putative 43rd president. cf. BULLSHIT

New I think that rule is slightly faulty anyway.
And that is because the grouping of digits in a phone number influences the memorability. Two groups of 4 digits are no harder to remember than one of 3 and one of 4. And those researchers might be astonished to discover that the Aussie mobile phone numbers are also memorable: and they're of the form 04xx yyy zzz! So much for the "7-digit" rule, as Darrell pointed out.

Wade.

Is it enough to love
Is it enough to breathe
Somebody rip my heart out
And leave me here to bleed
 
Is it enough to die
Somebody save my life
I'd rather be Anything but Ordinary
Please

-- "Anything but Ordinary" by Avril Lavigne.

New In A5a, it works like this.
Hey, thanks for the i18n explanation. That never would have occurred to me.

I've never understood the weird Yank convention of writing telephone numbers as "(123) 456-7890" and so on. How much of that is the area code? One would think, just the bit in parentheses -- but then WTF is the dash all about? And do I dial it all in one fell swoop, without pausing for a dial tone at any point? If so, then why have any weird delimiters at all? And if not, then where do I pause -- at the dash? After the bit in parentheses? Both? Neither? Who the fuck knows...


You got a lot of it right. It's historical baggage. The (123) is the Area Code. It used to be that you needed to dial that if you were calling Long Distance, and you didn't if it was a Local call.

AFAIK, the - is to help people remember the number. To us, phone numbers are said as: Four Five Six (pause) Seven Eight Nine Oh/Zero. It also goes back to the days of [link|http://ourwebhome.com/TENP/Recommended.html|"exchanges"] like BRoadway-549 and, later, GLenview6-7890. In those days, you'd probably have started off by talking to an operator though.

It makes a lot more sense to my ear to have a 3 pause 3 pause 4 number than what the UK seems to do (based on the [link|http://www.bbc.co.uk/worldservice/us/contact/index.shtml|BBC] numbers I've heard):

"Double Four (pause) Zero Two Zero Seven Two Four Zero (pause) Three Four Five Six"

Maybe we have a shorter attention span than the British. But Canada uses our system too, so it can't simply be that we're brain damaged.

It used to be that one had to pause after dialing 1 for Long Distance. I think the switching software doesn't care anymore.

A lot of metropolitan areas in the US require the use of an Area Code even for Local calls now, because so many numbers have been given out. But I still remember, and it wasn't that long ago, that one could dial 4 numbers in small towns in Ohio and reach the party you wanted in the same town.

HTH.

Cheers,
Scott.
New wrt Canada
well, we do that because the telephone was invented by a Canadian, so our phone system developed contemporaneously with yours. In short, your phone system is our phone system and vice versa.
--\n-------------------------------------------------------------------\n* Jack Troughton                            jake at consultron.ca *\n* [link|http://consultron.ca|http://consultron.ca]                   [link|irc://irc.ecomstation.ca|irc://irc.ecomstation.ca] *\n* Kingston Ontario Canada               [link|news://news.consultron.ca|news://news.consultron.ca] *\n-------------------------------------------------------------------
New Also, a11y.
"Accessibility"

:-)


Peter
[link|http://www.ubuntulinux.org|Ubuntu Linux]
[link|http://www.kuro5hin.org|There is no K5 Cabal]
[link|http://guildenstern.dyndns.org|Home]
Use P2P for legitimate purposes!
New That's why you're an international linguist...
...and I'm not!

Only last week did it strike me that 'internationalization' has twenty letters -- an 'i', eighteen various and sundry other letters, and an 'n'!


l33tspeak will kill this artform even more surely than Micros~1 could ever hope to!
jb4
shrub\ufffdbish (Am., from shrub + rubbish, after the derisive name for America's 43 president; 2003) n. 1. a form of nonsensical political doubletalk wherein the speaker attempts to defend the indefensible by lying, obfuscation, or otherwise misstating the facts; GIBBERISH. 2. any of a collection of utterances from America's putative 43rd president. cf. BULLSHIT

New I've had a little experience storing I18n phone numbers.
What I found is several things:

1. You can lookup the country code from the country if you have to. Or at least correlate it.
2. There is often an area code, but not always. Storing it separately brings up the problem of user input; keeping it with the rest of the number brings up the problem of when people omit entering it.
3. You will sometimes need an extension field. Make that separate.
4. There's no point parsing for exchange prefix.

That said, I myself would try to display numbers of the country the user is in in the national format. This will probably be what you will have stored; if you keep the area code in a separate field, you will need to know every local format. But I would then display numbers of any other country in international format. So here in AU, an US number would look like +1 801 555 1234 but an Au number would look like (02) 8543 1000. Conversely, in the US, the corresponding US number would look like either (801) 555-1234 or 1-801-555-1234 whilst the AU number would look like +61 2 8543 1000.

IME, the +code format is a far better visual clue of an international number than always displaying the number "ready to dial".

Wade.

Is it enough to love
Is it enough to breathe
Somebody rip my heart out
And leave me here to bleed
 
Is it enough to die
Somebody save my life
I'd rather be Anything but Ordinary
Please

-- "Anything but Ordinary" by Avril Lavigne.

New Maybe you have to assume some level of user knowledge
IME, the +code format is a far better visual clue of an international number than always displaying the number "ready to dial".
If you can rely on users knowing this conventoin, this sounds like a good solution to me. I suspect in most cases you would want your users to know when they're about to make an international call.[1]

Also, I don't think you can avoid having users who think they know better than the system what they're "supposed" to be doing. We have this issue just dealing with storage and presentation of numbers within the U.S. We only recently started requiring full 10-digit numbers at data entry.

The (old) logic was that the people using the numbers would most likely be in the same office as the people entering the numbers. So the one entering the number should enter it how it should be dialed. The problem with storing the full 10-digit number is that either the user or the system has to decide if the area code and the '1' are needed when dialing form the current location. Which means each fax server has to be aware of the area code it's dialing from and the current phone system rules for when it needs the extra digits.

If there were any sanity in the phone system, you could dial '1' and the full 10-digit number and your local exchange would figure out what to do and complete the call. But we still have cases where if you try that you can't make any local calls.




[1] But then again, calling from France to Spain isn't quite the same as calling from the U.S. to ... well, just about anywhere but Canada and Mexico. So I have no idea if intra-european rates are anywhere near what international rates from the U.S. are.
===

Purveyor of Doc Hope's [link|http://DocHope.com|fresh-baked dog biscuits and pet treats].
[link|http://DocHope.com|http://DocHope.com]
New Not to mention, having an International internal phone sys.
Some companies also have to consider least cost routing as well in determining call cost.

CIP: Let us say, a company headquartered in Detroit, has a national company with at least 1 store in each area code in the states. And has offices in major cites in most cities across the world. With a connected Phone system to all locales the office/stores are.

Let us say that some regional executive in Colorado's Store has a problem with a machine built in Tokyo Japan, needing direct support from them. The phone system will need to know how to route the call over the companies internal phone system. Making it a local call for the store/office in Tokyo. Since the already are paying for the connectivity to Japan, it is a reduced cost for them.

Just think of doing this... and capturing the info this way. Fun Fun Fun.
--
[link|mailto:greg@gregfolkert.net|greg],
[link|http://www.iwethey.org/ed_curry|REMEMBER ED CURRY!] @ iwethey

[link|http://it.slashdot.org/comments.pl?sid=134485&cid=11233230|"Microsoft Security" is an even better oxymoron than "Military Intelligence"]
No matter how much Microsoft supporters whine about how Linux and other operating systems have just as many bugs as their operating systems do, the bottom line is that the serious, gut-wrenching problems happen on Windows, not on Linux, not on Mac OS. -- [link|http://www.eweek.com/article2/0,1759,1622086,00.asp|source]
New Definitely.
Or factor in some user-training. In fact, you probably should *always* factor in some user-training. At the very least, it will bring the idiots up to a universal level of dumbness* and show everyone else how low the "idiot-proof" bar is set.

Wade.

* theroetically.

Is it enough to love
Is it enough to breathe
Somebody rip my heart out
And leave me here to bleed
 
Is it enough to die
Somebody save my life
I'd rather be Anything but Ordinary
Please

-- "Anything but Ordinary" by Avril Lavigne.

New The only thing you can assume
Is that there is a country code and then the rest of the number. That's it. You cannot assume that it is all numbers (1-800-FLOWERS) you cannot assume 3 digit area codes, seven digit numbers, or anything else like that. You can perhaps split out the extension. So you can have country code (3 digits), phone number (I'd provide 20 characters), and an extension - allow 7 characters.

I wouldn't bother to do any kind of formatting of the numbers at all. Let the person who enters the number provide the separators.



"Whenever you find you are on the side of the majority, it is time to pause and reflect"   --Mark Twain

"The significant problems we face cannot be solved at the same level of thinking we were at when we created them."   --Albert Einstein

"This is still a dangerous world. It's a world of madmen and uncertainty and potential mental losses."   --George W. Bush
New Have to disagree with that one
The formats you know, your classes should do validation. There's no point in storing a 6-digit number that is supposedly for the U.S.
===

Purveyor of Doc Hope's [link|http://DocHope.com|fresh-baked dog biscuits and pet treats].
[link|http://DocHope.com|http://DocHope.com]
New It would be a LOT of work
and I know of no library that is comprehensive.

Best not to do any rather than appear stupid.

Besides, the value of "validation" is limited - its not like a little set of heuristics is actually gonna guarantee that the number actually WORKS or anything.

I figure you're no worse off.



"Whenever you find you are on the side of the majority, it is time to pause and reflect"   --Mark Twain

"The significant problems we face cannot be solved at the same level of thinking we were at when we created them."   --Albert Einstein

"This is still a dangerous world. It's a world of madmen and uncertainty and potential mental losses."   --George W. Bush
Expand Edited by tuberculosis March 27, 2005, 11:31:45 PM EST
New No, Todd is right
Just take Italy for example. Phone numbers there can be either 9 or 10 digits including area code -- I'm not sure if more variations are possible, but I've seen these two variations.

IIRC, area codes used to be two digit (say before 1998), but are now three digit.

So you can't make assumptions, and the rules can change over time.

Tony
New Re: The only thing you can assume
You cannot assume that it is all numbers (1-800-FLOWERS) you cannot assume 3 digit area codes, seven digit numbers, or anything else like that.

Depending on what you are doing you may want to ban letters entirly. Keypad letter to number mappings vary somewhat across countries, and even slighly inside the US.

You can perhaps split out the extension. So you can have country code (3 digits), phone number (I'd provide 20 characters), and an extension - allow 7 characters.

20 is probably over kill, I think the standard limits the country internal part of phone numbers to 10 digits. Even allowing some leway for dashes and space for possible future expansion, 20 is probably excessive. Of course, if your doing the sane thing and dropping it in a varchar there is no reason to limit it at the database level. And on the other hand, for some applications even 20 would not be enough. I use a calling card for long distance calls, if I'm programming that into a system to make outbound calls it's going to be an 800 number, followed by my card number, followed by the actual number I'm trying to dial.

I would make the space for extension longer. I often put the keys to navigate menus in the extension field to keep it handy. With some of the hosting companies I've dealt with it's an extension, followed by mulitple levels of touch pad menu.

I guess the ultimate point here is that it isn't enough to say your storing phone numbers. How much space you need and what you want to allow in the phone number depends partially on what the number is going to used for.

Jay
     Phone numbers and i18n - (Yendor) - (39)
         Only thing I would question - (jake123)
         If you want to make your display useful - (Arkadiy) - (3)
             What else could you store it as? -NT - (drewk)
             Re: If you want to make your display useful - (Yendor) - (1)
                 Country code, area code, main number, extension -NT - (Arkadiy)
         Re: Phone numbers and i18n - (JayMehaffey) - (1)
             Re: Phone numbers and i18n - (Yendor)
         Basically, you're totally wrong, and your colleague right. - (CRConrad) - (22)
             American users are helped by it - (drewk) - (17)
                 In Charlotte, and surrounding area,... - (a6l6e6x)
                 No - (tuberculosis) - (15)
                     True, if everything's 10-digit no need for the '1' -NT - (drewk)
                     the leading one is to route to a stp for long distance - (boxley) - (2)
                         I know why its there - (tuberculosis) - (1)
                             duh, forgot about that :-) - (boxley)
                     Here too - (SpiceWare)
                     Well, (probably because I'm a contrarian) - (jb4) - (9)
                         Note on "overlaid" area codes. - (static) - (8)
                             Houston did both - (SpiceWare) - (7)
                                 Sounds like they didn't give enough notice. - (static) - (1)
                                     wasn't much - (SpiceWare)
                                 Re: Houston did both - (JayMehaffey)
                                 The reason our "Bell system" will NEVER increase... - (jb4) - (3)
                                     rule of 7 is long gone - (SpiceWare) - (2)
                                         Yes, of course - (jb4) - (1)
                                             I think that rule is slightly faulty anyway. - (static)
             In A5a, it works like this. - (Another Scott) - (1)
                 wrt Canada - (jake123)
             Also, a11y. - (pwhysall)
             That's why you're an international linguist... - (jb4)
         I've had a little experience storing I18n phone numbers. - (static) - (3)
             Maybe you have to assume some level of user knowledge - (drewk) - (2)
                 Not to mention, having an International internal phone sys. - (folkert)
                 Definitely. - (static)
         The only thing you can assume - (tuberculosis) - (4)
             Have to disagree with that one - (drewk) - (2)
                 It would be a LOT of work - (tuberculosis)
                 No, Todd is right - (tonytib)
             Re: The only thing you can assume - (JayMehaffey)

What you just said is one of the most insanely idiotic things I have ever heard. Everyone in this room is now dumber for having listened to it.
120 ms