aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ejabberd_ctl.erl6
-rw-r--r--src/mod_http_api.erl1
2 files changed, 6 insertions, 1 deletions
diff --git a/src/ejabberd_ctl.erl b/src/ejabberd_ctl.erl
index 354e5ba2f..77595cd54 100644
--- a/src/ejabberd_ctl.erl
+++ b/src/ejabberd_ctl.erl
@@ -378,7 +378,11 @@ format_arg("", string) ->
format_arg(Arg, string) ->
NumChars = integer_to_list(length(Arg)),
Parse = "~" ++ NumChars ++ "c",
- format_arg2(Arg, Parse).
+ format_arg2(Arg, Parse);
+format_arg(Arg, Format) ->
+ S = unicode:characters_to_binary(Arg, utf8),
+ JSON = jiffy:decode(S),
+ mod_http_api:format_arg(JSON, Format).
format_arg2(Arg, Parse)->
{ok, [Arg2], _RemainingArguments} = io_lib:fread(Parse, Arg),
diff --git a/src/mod_http_api.erl b/src/mod_http_api.erl
index 427833584..023df39ca 100644
--- a/src/mod_http_api.erl
+++ b/src/mod_http_api.erl
@@ -30,6 +30,7 @@
-behaviour(gen_mod).
-export([start/2, stop/1, reload/3, process/2, depends/2,
+ format_arg/2,
mod_options/1, mod_doc/0]).
-include_lib("xmpp/include/xmpp.hrl").