George480 / geolite

GeoLite2 for San Andreas Multiplayer
MIT License
8 stars 4 forks source link

Databases charset #4

Open Walter-Correa opened 4 years ago

Walter-Correa commented 4 years ago

Hello. Could you set the databases charset to UTF8? Some names of cities / provinces in Latin America do not appear correctly. I appreciate it if you can do that!

George480 commented 4 years ago

Could you please provide their geoname_id or part of name so I can make sure they will be correct on the next update? Thank you.

Walter-Correa commented 4 years ago

Hello.

All geoname_ids from all south América countries: http://www.geonames.org/childrenJSON?geonameId=6255150

All geoname_ids from all state/province from Brazil: http://www.geonames.org/childrenJSON?geonameId=3469034

My server is Brazilian, if you add utf8 to provinces and cities I thank you so much. If you use the second link you will get all 26 states/provinces from Brazil and their names. If you put the geoid of each state at the end of the link you will get all cities.

If you need some more info just tell me. Sorry my english!

George480 commented 4 years ago

I can view the names correctly with a browser so I think it might be an issue with server encoding, the way it displays them.

Can you open the include and add:

db_free_result(db_query(GEOLITE_province_db, "PRAGMA encoding=\"UTF-8\";"));

at the end of if (fexist("maxmind_province.db")) block? Let me know if it has any difference.

Walter-Correa commented 4 years ago

None difference. Unfortunately it didn't work. :(

George480 commented 4 years ago

Writing the output to a file has the correct encoding, however printing in console outputs random characters. I am clueless how to make it work with non-English languages.

Walter-Correa commented 4 years ago

I understand... I'm using the utf8decode() from strlib.inc, but I found bugs: https://github.com/oscar-broman/strlib/issues/21