开发者

UI Phone number accepting - international format

Are there any standards for phone number across the world. I would like to create one UI to accept the phone number Depending on country the phone number accepting dialog should be changed like in US it should be +1-408-567-9822 Ther开发者_如何转开发e are different such types of conventions getting followed across the world. Are there any location to get all standards or code to format the phone numbers.


There are different formats in different countries e.g. my phone numbers in the UK are 020 8xx xxxx and 07963 xxx xxx but noit every one uses these formats for various reasons e.g. many write the first as 0208 xxx xxx and the latter as 0796 3xxx xxx also (020) 8xx xxx. And also if cutting and pastin you might have 0208xxxxxx

Thus my view is that there there is no satisfactory format just accept any sequence of numbers and characters and ignore the characters having the correct number of digits. I would choose the country separately so the +1 for America , +44 for UK so that you can dial locally if in the country, but the rest are just any numbers,


There is a standard, E.164. There are libraries available for handling phone numbers, such as libphonenumber.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜