Git Product home page Git Product logo

Comments (6)

twcclegg avatar twcclegg commented on July 27, 2024

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.

orihomie avatar orihomie commented on July 27, 2024

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.

twcclegg avatar twcclegg commented on July 27, 2024

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.

orihomie avatar orihomie commented on July 27, 2024

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.

twcclegg avatar twcclegg commented on July 27, 2024

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.

orihomie avatar orihomie commented on July 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.