Em 12-03-2010 09:29, Helge Hafting escreveu: > Sybren A. Stüvel wrote: >> Hi folks, >> >> I had a discussion with TAsn on #openmoko-cdevel about telephone >> number normalization in opimd. The discussion was triggered by my >> inspection of the sqlite database, where I saw that it's impossible to >> index on a telephone number. >> >> TAsn argued that queying for a number is difficult, and that always >> storing the number in normalized form is not possible. For example, an >> Israeli could enter & use a local French phone number while on holiday >> in France. TAsn argued that it should be stored as a local number, >> because otherwise it would be stored as a number with the Israel >> country prefix from the SIM. >> >> I think a simple solution would be to ask the user the correct country >> (for example the choice "the country you're in now" and "your own >> country") before storing the contact. That would allow OPIM to always >> have the correct country prefix. > > In that case, just default to "the country you're in now". (Which > usually also is the same as "your own country".) This way, people won't > actually have to deal with this setting in the common cases. > >> Some people may think this is a pain, to have to answer such a >> question every time a number is added. > This can be avoided completely, by using existing conventions: > > * Any number entered that starts with a numeral (0-9) is a number local > to whatever country you're in when the number is entered. > (Just as if you dial with the dialer app.) In these cases, just > add the prefix automatically. > > * Numbers in other countries (foreign numbers or home numbers when > you're travelling) are entered with a plus sign followed by the > country code, and then the number itself. To enter a norwegian > number outside norway for example, add it using +47 in front. > > * A user adding the prefix for the country he happens to be in, > should not cause any problem. That's just an "explicit local" > number, it will be stored in the same way as any other > number. > > This way, no numbers are "different". They are all stored the > same way. A user that screw up because he don't know what > country he is in, can simply fix his mistakes by > editing the numbers again. It is kind of obvious when > you look at the entry and see the (wrong) country code > that was added automatically. > > This is similar to what other phones do. It works > with foreign numbers also, and people do > add numbers in several countries. Some have family > in a neighbour country, some are business travelers > with a favourite hotel and foreign customers.
I never saw a phone do that. My experience comes from Nokias: they just add what the user typed and blindly try to use that. When I was abroad and tried to call a number without any prefix, it tried to call that number in the roaming provider network, not in the Portuguese network. The simplest form follows the KISS principle and works best: only store what the user typed in and don't try to be "smart" thus introducing another set of problems. Less features (doubtfull usefulness anyway), mean less bugs, and this is surely one feature that has *only* added problems. A typical phone user is perfectly capable to fix the stored number to use international form if he intends to do so. This is a clear example of avoidable featuritis. KISS works best. And for phone number to name match, nothing simpler: match from end, not from start of number. Surely this match has flaws if you consider the whole set of possible numbers, but in practice you won't have much more than a few hundreds (at most) of contact data so that is not a real problem. Rui _______________________________________________ Shr-devel mailing list Shr-devel@lists.shr-project.org http://lists.shr-project.org/mailman/listinfo/shr-devel