Skip to content

Commit d666153

Browse files
Ensure locale is detected correctly by lua-cjson.
Fixes bug #49
1 parent 8d32e90 commit d666153

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

matrix.lua

+3-1
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,9 @@ function real_http_cb(extra, command, rc, stdout, stderr)
529529
-- Skip to data
530530
stdout = (stdout:match('.-\r?\n\r?\n(.*)'))
531531
-- Protected call in case of JSON errors
532-
local success, js = pcall(json.decode, stdout)
532+
-- Ensure that locale is detected correctly (fixes bug #49)
533+
local localejson = json.new()
534+
local success, js = pcall(localejson.decode, stdout)
533535
if not success then
534536
mprint(('error\t%s during json load: %s'):format(js, stdout))
535537
return w.WEECHAT_RC_OK

0 commit comments

Comments
 (0)