Closed dezull closed 1 month ago
Getting name of the Myanmar (Burma) is also impossible due to this issue unfortunately
Hi, forgot about this. Someone could've make a PR :) But looks like no volunteers. I'll check it out and update tests to make sure those countries are found properly.
@dezull @osztenkurden please check if v3.1.1 works for you. Increased test coverage so seems fine with any name now.
Use case for the feature
For example,
getCountryCode("Cocos (Keeling) Islands")
won't return the correct country code, because of the parentheses in the country name.Examples or links
The
countryName
used in the RegExp in the function is not escaped, so characters such as parentheses are interpreted as special characters:The solution in https://github.com/annexare/Countries/issues/131 can fix this, or a slight modification:
Maybe allowing something like "Cocos Islands" or "Keeling Islands" also makes sense?