From 4316ff068b14eff72d3adecd432a602a453db95d Mon Sep 17 00:00:00 2001 From: Pierre Ynard Date: Sat, 31 Aug 2013 17:29:33 +0200 Subject: [PATCH] lua dkjson: use us_tostring() to fix locale issues with decimals This only fixes encoding but we don't use decoding anyway. Fixes #8854 --- share/lua/modules/dkjson.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/share/lua/modules/dkjson.lua b/share/lua/modules/dkjson.lua index 987587bbc5..05bf11c9ba 100644 --- a/share/lua/modules/dkjson.lua +++ b/share/lua/modules/dkjson.lua @@ -196,6 +196,8 @@ local strrep, gsub, strsub, strbyte, strchar, strfind, strlen, strformat = string.rep, string.gsub, string.sub, string.byte, string.char, string.find, string.len, string.format local concat = table.concat +local common = require ("common") +local us_tostring = common.us_tostring if _VERSION == 'Lua 5.1' then local function noglobals (s,k,v) error ("global access: " .. k, 2) end @@ -367,7 +369,7 @@ encode2 = function (value, indent, level, buffer, buflen, tables, globalorder) -- This is the behaviour of the original JSON implementation. s = "null" else - s = tostring (value) + s = us_tostring (value) end buflen = buflen + 1 buffer[buflen] = s -- 2.39.5