Comments (6)
I'm not sure I fully understand your issue, are you able to try out the numbers using http://libphonenumber.appspot.com? +70161610088 and +70011610088 show up as invalid
from libphonenumber-csharp.
Hi, @twcclegg.
They got parsed fine (or it only seems for me) with options:
defaultCountry entered: RU
Language entered: ru-RU
Still, my issue is what that numbers with leading zeros are parsed into long without them (its nature into parsing any string with leading zeros into long):
long.Parse("001") -> 1
so 'GetLengthOfNationalDestinationCode' function returns wrong value of national destination code length (it's 0), because the array inside has it's value (for example) {"7", "16160088"}
I'd like to parse out national destionation code and subscriber number out of national number without any other hacks.
from libphonenumber-csharp.
Can you send me a link like http://libphonenumber.appspot.com/phonenumberparser?number=%2B74011610088 that shows the number(s) in question in E.164 format that shows it as possible and valid along with AsYouTypeFormatter results? https://en.wikipedia.org/wiki/Telephone_numbers_in_Russia#List_of_area_codes_in_Russia says all area codes starting with a 0 expired in 2006.
from libphonenumber-csharp.
70161610088 parse result
70061610088 parse result
Despite that they are all expired - we're able to use them inside of our infrastructure (I'm working in one of Russia's telecom company), so numbers like this are still in db's.
from libphonenumber-csharp.
Yes, as it shows, both have isValidNumber
as flase
, and otherwise invalid
. You would have to file an issue with Google. They maintain what is valid.
from libphonenumber-csharp.
I'm clearing my subscriptions for now and as I remember as we spoke last time - author said number format with leading zeros is invalid and I've agreed with him for a while... until I've got a call from a number with leading zero.
So, this is not about Google and their decisions, this is about usability that provides some kind of comfort to work with.
That's all my thoughts, bye.
from libphonenumber-csharp.
Related Issues (20)
- How to parse without getting exception for wrong format? HOT 10
- Country Code is added to NationalNumber in PhoneNumber Object if Number is too short HOT 1
- Could not load file or assembly 'System.IO.Compression HOT 6
- Document how changes in Google's base library are included or not HOT 2
- Strong named assemblies HOT 2
- Make metadata update and publish new version fully automatically HOT 1
- New Kazakhstan country code. HOT 1
- Could not interpret numbers after plus-sign when parsing +00000000000000 HOT 3
- Missing or invalid default region. HOT 2
- IsPossibleNumberForTypeWithReason returns valid mobile when IsValidNumber returns invalid HOT 1
- Valid US number is resulting in IsValid to false HOT 4
- Parsing phone number as valid when it starts with _ HOT 9
- GetNumberType always returns UNKNOWN HOT 2
- Breaking change in PhoneNumberUtil.Normalize HOT 2
- Enable nullable reference types
- American phone not correctly parsed? HOT 2
- Version 8.13.26 causes IndexOutOfRangeException HOT 3
- Vietnamese phone number does not validate HOT 1
- French mobile numbers with prefix "07" are not detected as mobile numbers HOT 2
- docs: codecov badge on README leads to old trunk branch "master" instead of the new "main" branch HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libphonenumber-csharp.