Comment #1 on issue 879 by nicolas.graziano: geo.getCurrentPosition do not
return good position on linux with locale fr_FR
http://code.google.com/p/gears/issues/detail?id=879
I found the source of the problem. The problem is that jsoncpp assumes that
the
locale is "C". The method "decodeDouble" use the french decimal separator
which is
"," instead of ".".
Here a patch to switch to C locale during json parse.
--- third_party/jsoncpp/json_reader.cc (révision 3368)
+++ third_party/jsoncpp/json_reader.cc (copie de travail)
@@ -68,7 +68,11 @@
document_ = document;
const char *begin = document_.c_str();
const char *end = begin + document_.length();
- return parse( begin, end, root, collectComments );
+ char *saved_l = setlocale(LC_NUMERIC,"C");
+ bool result =parse( begin, end, root, collectComments );
+ setlocale(LC_NUMERIC,saved_l);
+
+ return result;
}
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings