libphonenumber-csharp icon indicating copy to clipboard operation
libphonenumber-csharp copied to clipboard

Belgian number not recognized

Open JWLB-IT opened this issue 5 years ago • 7 comments

Hi, I found out that a number starting with 0456 / XX XX XX is not recognized as a valid Belgian phone number. I did the test on the Java version demo and there it's accepted and I could even see the provider.

Is this possible to fix this in a new version? I currently use version 8.10.15. A list of possible Belgian numbers is listed on this website: https://en.wikipedia.org/wiki/Telephone_numbers_in_Belgium

Thanks Jo

JWLB-IT avatar Jul 28 '19 08:07 JWLB-IT

Hi Jo,

I'll look into this and report back.

jimbo8098 avatar Sep 26 '19 09:09 jimbo8098

I ran the following and got what I would expect back:

        static void Main(string[] args)
        {
            Console.WriteLine("Phone Number Tester");
            var numList = new List<string>()
            {
                "+32 0456 12 34 56",
                "+32 04 56 123 456",
                "+32 0456 12 34 56",
                "+320456123456",
                "+320456 12 34 56",
                "0456 12 34 56",
                "0456123456"
            };

            var inst = PhoneNumbers.PhoneNumberUtil.GetInstance();
            foreach (var num in numList)
            {
                Console.WriteLine($"I[{num}]: {ParseInternational(inst,num)}");
                Console.WriteLine($"N[{num}]: {ParseNational(inst,num)}");
            }
            Console.ReadLine();
        }

The two function calls simply provide or don't provide the country code as a default and enclose it in a try-catch.

When ran, I received the following:

image

Could you send the code you used to parse the number and the number in it's particular format? I don't suppose the other digits will matter but we'll probably figure that out.

jimbo8098 avatar Sep 26 '19 09:09 jimbo8098

Hi, I'll check it out asap and come back to you. Regards Jo


From: Jim Speir [email protected] Sent: Thursday, September 26, 2019 11:39:04 AM To: erezak/libphonenumber-csharp [email protected] Cc: Jo Wouters [email protected]; Author [email protected] Subject: Re: [erezak/libphonenumber-csharp] Belgian number not recognized (#32)

I ran the following and got what I would expect back:

` static void Main(string[] args) { Console.WriteLine("Phone Number Tester"); var numList = new List() { "+32 0456 12 34 56", "+32 04 56 123 456", "+32 0456 12 34 56", "+320456123456", "+320456 12 34 56", "0456 12 34 56", "0456123456" };

    var inst = PhoneNumbers.PhoneNumberUtil.GetInstance();
    foreach (var num in numList)
    {
        Console.WriteLine($"I[{num}]: {ParseInternational(inst,num)}");
        Console.WriteLine($"N[{num}]: {ParseNational(inst,num)}");
    }
    Console.ReadLine();
}`

When ran, I received the following:

[image]https://user-images.githubusercontent.com/12417556/65677534-b4ad4700-e049-11e9-9399-537c51078dfc.png

Could you send the code you used to parse the number and the number in it's particular format? I don't suppose the other digits will matter but we'll probably figure that out.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/erezak/libphonenumber-csharp/issues/32?email_source=notifications&email_token=AMXL2TY7JVUV3ZWGRGBZDVTQLR7LRA5CNFSM4IHL7ZBKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7U67FQ#issuecomment-535424918, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMXL2TYRDHAY7GXJOSHEBMLQLR7LRANCNFSM4IHL7ZBA.

JWLB-IT avatar Sep 27 '19 05:09 JWLB-IT

Hi, I managed to strip the project which reproduces the bug. A small document describes a walkthrough to get to it. Download

Good luck

JWLB-IT avatar Oct 27 '19 11:10 JWLB-IT

The download was no longer available. Here is a new link download

JWLB-IT avatar Dec 09 '19 06:12 JWLB-IT

The download was no longer available. Here is a new link download

Hello, the links you shared seem to be broken. Could you please share the walkthrough with a new link? I am having the same issue with Belgian numbers.

medyi avatar Aug 26 '21 09:08 medyi

Hi,

I have cleaned up this last week because of space issues and the fact that it was old. The problem occurred when I did a verification from a webpage. If I run the same via a UnitTest, all works fine.

I took a printscreen from the source code of the entire application of my client.

@.***

I hope this helps you.

Regards Jo

Van: Mehdi @.> Verzonden: donderdag 26 augustus 2021 11:12 Aan: erezak/libphonenumber-csharp @.> CC: Jo Wouters @.>; Author @.> Onderwerp: Re: [erezak/libphonenumber-csharp] Belgian number not recognized (#32)

The download was no longer available. Here is a new link downloadhttps://jwlb-my.sharepoint.com/:u:/g/personal/jo_jwlb-it_be/EY0IBUTsNn9Cs6mkzeJ5l6EBdZyqVmqPoS0fpGoVClIleA?e=2j8Rao

Hello, the links you shared seem to be broken. Could you please share the walkthrough with a new link? I am having the same issue with Belgian numbers.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/erezak/libphonenumber-csharp/issues/32#issuecomment-906233962, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AMXL2TZO2W7L7LQBY5AHKATT6YAORANCNFSM4IHL7ZBA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email.

JWLB-IT avatar Aug 28 '21 07:08 JWLB-IT