[vlc-commits] lua dkjson: use us_tostring() to fix locale issues with decimals
Pierre Ynard
git at videolan.org
Sat Aug 31 17:33:18 CEST 2013
vlc | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Sat Aug 31 17:29:33 2013 +0200| [4316ff068b14eff72d3adecd432a602a453db95d] | committer: 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
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4316ff068b14eff72d3adecd432a602a453db95d
---
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 987587b..05bf11c 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
More information about the vlc-commits
mailing list