[vlc-commits] lua dkjson: use us_tostring() to fix locale issues with decimals
Pierre Ynard
git at videolan.org
Sat Aug 31 17:51:07 CEST 2013
vlc/vlc-2.1 | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Sat Aug 31 17:29:33 2013 +0200| [0b58c4d4839926c818b56f3410f9bea619e45f2f] | 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
(cherry picked from commit 4316ff068b14eff72d3adecd432a602a453db95d)
Signed-off-by: Pierre Ynard <linkfanel at yahoo.fr>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.1.git/?a=commit;h=0b58c4d4839926c818b56f3410f9bea619e45f2f
---
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