CXuesong / WikiClientLibrary

/*🌻*/ Wiki Client Library is an asynchronous MediaWiki API client library targeting modern .NET platforms
https://github.com/CXuesong/WikiClientLibrary/wiki
Apache License 2.0
82 stars 16 forks source link

Coordinate query fails on some thread cultures #46

Closed Firedragonweb closed 5 years ago

Firedragonweb commented 5 years ago

Since the GeoSearchGenerator uses standard ToString for coordinate latitudes and longitudes, the api returns invalid coordinates, if the current thread culture is set to a culture, where decimal places are separated using a comma "," instead of a point ".". I suggest using the ToString overload with a CultureIdentifier and using InvariantCulture in all relevant places.

CXuesong commented 5 years ago

Published v0.6.5. Hope it helps!

Firedragonweb commented 5 years ago

Great, thanks a lot! I should have mentioned I have a workaround (temporarily changing the threads culture) so it wasn't that urgent. But great job anyway!

CXuesong commented 5 years ago

Or you may always implementing your own PageGenerator by slightly change the GeoSearchGenerator source code a bit ^_^

Since the issue is addressed, I will close it for now.