libphonenumber-csharp
libphonenumber-csharp copied to clipboard
Belgian number not recognized
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
Hi Jo,
I'll look into this and report back.
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:
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.
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.
Hi, I managed to strip the project which reproduces the bug. A small document describes a walkthrough to get to it. Download
Good luck
The download was no longer available. Here is a new link download
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.
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.