alcohol / iso3166

A PHP library providing ISO 3166-1 data.
https://iso3166.thephpleague.com
MIT License
640 stars 59 forks source link

Fixed country name string compare to work with unicode #78

Closed 8ctopus closed 1 year ago

8ctopus commented 1 year ago

Hi there,

I found a significant issue in the library when looking up for a country that contains non ASCII characters such as Côte d'Ivoire. The current function to case-insensitive string compare does only work in the ASCII range but not with unicode. More information on the issue can be found here for example: https://stackoverflow.com/questions/5473542/case-insensitive-string-comparison

I've fixed it and added a test for it.

8ctopus commented 1 year ago

Anyone alive on the project?

alcohol commented 1 year ago

Sorry, I have not found much time to work on my open source projects for quite some time now. This change is trivial though and definitely welcome. I'll get it sorted today and get a new release out.

alcohol commented 1 year ago

Rebased and merged in 40ab84897f7944566d571ed8745fd5629dd2b566