Closed tokengeek closed 12 years ago
So it looks like the codes 37, 38 and 42 should be removed when it is finding the country code. Does that sound right?
I think that's right. I think it's unlikely you would want to retain the old data in order to match numbers which are no longer in use.
Thank you @scsmith for the fix.
When using
E164.parse
with "+" formatted numbers the country_code for 21 countries is incorrect.These relate to three digit codes that the the first two digits match a discontinued code.
For example for a number in the Czech Republic (420):
"42" is 'previously assigned to [Czechoslovakia] until its breakup. Czech Republic and Slovakia used this common code until 1 March 1997.'
I've added test cases to be added in to
spec/e164_spec.rb
Running this against 69f6236 gives 22 failures. 1 for the special Czech Republic case and 21 for all the cases where the parsing seems to pick up on a shorter code first.
List of affected Countries: