Commit 4316ff06 authored by Pierre Ynard's avatar Pierre Ynard

lua dkjson: use us_tostring() to fix locale issues with decimals

This only fixes encoding but we don't use decoding anyway.

Fixes #8854
parent f2ace097
...@@ -196,6 +196,8 @@ local strrep, gsub, strsub, strbyte, strchar, strfind, strlen, strformat = ...@@ -196,6 +196,8 @@ local strrep, gsub, strsub, strbyte, strchar, strfind, strlen, strformat =
string.rep, string.gsub, string.sub, string.byte, string.char, string.rep, string.gsub, string.sub, string.byte, string.char,
string.find, string.len, string.format string.find, string.len, string.format
local concat = table.concat local concat = table.concat
local common = require ("common")
local us_tostring = common.us_tostring
if _VERSION == 'Lua 5.1' then if _VERSION == 'Lua 5.1' then
local function noglobals (s,k,v) error ("global access: " .. k, 2) end 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) ...@@ -367,7 +369,7 @@ encode2 = function (value, indent, level, buffer, buflen, tables, globalorder)
-- This is the behaviour of the original JSON implementation. -- This is the behaviour of the original JSON implementation.
s = "null" s = "null"
else else
s = tostring (value) s = us_tostring (value)
end end
buflen = buflen + 1 buflen = buflen + 1
buffer[buflen] = s buffer[buflen] = s
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment