diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl index 5e9c7ce..43d9319 100644 --- a/src/rabbit_misc.erl +++ b/src/rabbit_misc.erl @@ -1003,7 +1003,7 @@ sequence_error([_ | Rest]) -> sequence_error(Rest). json_encode(Term) -> try - {ok, mochijson2:encode(Term)} + {ok, rc_mochijson2:encode(Term)} catch exit:{json_encode, E} -> {error, E} @@ -1011,7 +1011,7 @@ json_encode(Term) -> json_decode(Term) -> try - {ok, mochijson2:decode(Term)} + {ok, rc_mochijson2:decode(Term)} catch %% Sadly `mochijson2:decode/1' does not offer a nice way to catch %% decoding errors... diff --git a/src/mochijson2.erl b/src/rc_mochijson2.erl similarity index 99% rename from src/mochijson2.erl rename to src/rc_mochijson2.erl index bddb52c..2140bb2 100644 --- a/src/mochijson2.erl +++ b/src/rc_mochijson2.erl @@ -41,7 +41,7 @@ %% %% --module(mochijson2). +-module(rc_mochijson2). -author('bob@mochimedia.com'). -export([encoder/1, encode/1]). -export([decoder/1, decode/1, decode/2]). @@ -699,7 +699,7 @@ encoder_utf8_test() -> encode(<<1,"\321\202\320\265\321\201\321\202">>), %% raw utf8 output (optional) - Enc = mochijson2:encoder([{utf8, true}]), + Enc = rc_mochijson2:encoder([{utf8, true}]), [34,"\\u0001",[209,130],[208,181],[209,129],[209,130],34] = Enc(<<1,"\321\202\320\265\321\201\321\202">>).