ToQueryString behavior in cultures with comma decimal separator


Great Work. I have run into an issue. The ToQueryString() in GLocalSearch does not work when using it on systems with a culture using comma as a decimal separator. A fix could be to use CultureInfo.InvariantCulture.NumberFormat.
Closed Feb 28, 2009 at 4:01 AM by MarkBetz
Version 1.1 closes this issue.


FBrink wrote Jan 14, 2009 at 8:08 PM

It is just an incorrect querystring and thus an incorrect result (No exceptions / errors). A latitude / longitude of 56.09 / 10.12 translates into the string as ”56,09,10,12”. Usually the results are from the United States.

MarkBetz wrote Jan 15, 2009 at 2:23 AM

Ok, thanks. I will have a look at this within the next day or two. Appreciate the feedback!

MarkBetz wrote Jan 15, 2009 at 5:24 AM

Google's format for the querystring parameter is lat,long, so there can't be commas in the decimals. The fix is to convert numbers in the correct culture as FBrink suggested. Also need to survey the rest of the search classes to make sure this won't pop up anywhere else (News, for example, which has a location argument).

wrote Jan 15, 2009 at 5:24 AM

MarkBetz wrote Feb 28, 2009 at 4:01 AM

Issue closed in version 1.1.

wrote Feb 28, 2009 at 4:01 AM

wrote Feb 2, 2013 at 5:33 AM

wrote May 15, 2013 at 3:25 AM