Quantcast
Channel: WE MOVED to github.com/microsoft/cpprestsdk. This site is not monitored!
Viewing all articles
Browse latest Browse all 4845

Edited Issue: JSON serializer generates invalid JSON in non-C locales [118]

$
0
0
Using Casablanca 2.0, compile and run the following program:
```
#include <assert.h>
#include <locale.h>
#include <cpprest/json.h>
int main()
{
setlocale(LC_ALL, "fr-FR");
auto x = web::json::value(1.5).serialize();
wprintf(L"%s\n", web::json::value(1.5).serialize().c_str());
}
```
Expected results:
1.5
Actual results:
1,5
In the French locale, the radix character is a comma, not a period. The JSON serializer should not rely on a particular global locale state.


Viewing all articles
Browse latest Browse all 4845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>