From 2416b145073211b840781da6abf4b6d97f4657a6 Mon Sep 17 00:00:00 2001 From: Mark Pulford Date: Fri, 30 Dec 2011 14:17:44 +1030 Subject: Add fpconv to work around comma decimal points Create a separate buffer and translate comma <> dot before calling strtod(), and after calling sprintf() as required. - Add "update_locale" Lua API call and init locale on module load. - Move sprintf format string to fpconv --- tests/test.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests') diff --git a/tests/test.lua b/tests/test.lua index bb696a2..bdae6ea 100755 --- a/tests/test.lua +++ b/tests/test.lua @@ -211,12 +211,14 @@ local escape_tests = { local locale_tests = { function () os.setlocale("cs_CZ") + cjson.update_locale() return "Setting locale to cs_CZ (comma separator)" end, { json.encode, { 1.5 }, true, { '1.5' } }, { json.decode, { "[ 10, \"test\" ]" }, true, { { 10, "test" } } }, function () os.setlocale("C") + cjson.update_locale() return "Reverting locale to POSIX" end } -- cgit v1.2.3-55-g6feb