From d8a3f1404382b338571624794254c606d0ef3e99 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Mon, 4 Jun 2018 22:12:57 +0200 Subject: added local win32 fork of json-c here --- src/3rdParty/json-c/tests/test_locale.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/3rdParty/json-c/tests/test_locale.c (limited to 'src/3rdParty/json-c/tests/test_locale.c') diff --git a/src/3rdParty/json-c/tests/test_locale.c b/src/3rdParty/json-c/tests/test_locale.c new file mode 100644 index 0000000..da070cf --- /dev/null +++ b/src/3rdParty/json-c/tests/test_locale.c @@ -0,0 +1,31 @@ +#include +#include +#include +#include +#include + +#include "config.h" +#include "json.h" +#include "json_tokener.h" + +#ifdef HAVE_LOCALE_H +#include +#endif /* HAVE_LOCALE_H */ + +int main(int argc, char **argv) +{ + json_object *new_obj; +#ifdef HAVE_SETLOCALE + setlocale(LC_NUMERIC, "de_DE"); +#else + printf("No locale\n"); +#endif + + MC_SET_DEBUG(1); + + new_obj = json_tokener_parse("[1.2,3.4,123456.78,5.0,2.3e10]"); + printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj)); + printf("new_obj.to_string()=%s\n", json_object_to_json_string_ext(new_obj,JSON_C_TO_STRING_NOZERO)); + json_object_put(new_obj); +} + -- cgit v1.2.3-54-g00ecf